i have 2 tables relation one-to-one:
**message**(id, name, content)
**scheduled_message**(message_id, start_time, stop_time)
i use message_id as primary key of scheduled_message table.
my domain class:
public class Message {
private Integer id;
private String name;
private String content;
...
}
public class ScheduledMessage {
private Message message;
private Date startTime;
private Date stopTime;
}
i try write hibernate xml config to map 2 classes, but still error in message_id :(
<class name="Message" table="message">
<id name="id" column="id">
<generator class="native" />
</id>
<property name="name" column="name" />
<property name="content" column="content" />
</class>
<class name="ScheduledMessage" table="scheduled_message">
<id name="message" column="message_id">
<generator class="foreign">
<param name="property">message</param>
</generator>
</id>
<property name="startTime" column="start_time" />
<property name="stopTime" column="stop_time" />
<one-to-one name="message" constrained="true"/>
</class>
error: Could not determine type for: cbs.domain.Message, at table: scheduled_message, for columns: [org.hibernate.mapping.Column(message_id)]
help me plz
thanks
Quan