以下に 2 つの POJO があります。
public class Notification extends AbstractDomainObject{
private String name;
private List<User> users;
//setter getter
}
public class User extends AbstractDomainObject{
private String userName;
//getter setter
}
public class AbstractDomainObject{
private Long id;
//getter setter
}
私のHibernate Mappingは
<hibernate-mapping >
<class name="User" table="user">
<id name="id" type="long" column="id">
<generator class="native" />
</id>
<property name="userName" type="string">
<column name="user_name" />
</property>
</class>
<class name="Notification " table="notification">
<id name="id" type="long" column="id">
<generator class="native" />
</id>
<property name="name" type="string">
<column name="name" />
</property>
<list name="users" table="notification_for" cascade="all-delete-orphan" >
<key column="notification_id" />
<list-index column="idx" />
<one-to-many class="User" />
</list>
</class>
</hibernate-mapping>
notification_for
ユーザーと通知のマッピングのために、休止状態が別のテーブル()を維持する必要があることを望みます。
休止状態が行っているのはidx
、
テーブルnotification_id
内の維持です。休止状態が列をuser
持つテーブルを維持する必要があり、 どうすればよいですか。なにか提案を?notification_for
user_id
notification_id