Hibernate version: 3.1.3
I am trying to store an array of Strings from my POJO using hibernate. The POJO looks something like this:
Code:
public class Task {
private Long id;
private String owner;
private Date creationDate;
private String task;
private String[] items;
...
}
The rest of the class is pretty easy to map but I can't figure out the array of strings. I tried using primitive-array but that did not work for some reason. Something about not handling an error. I also tried the array tag but that seemed to require another class which I do not have.
Here is the mapping without the items field:
Code:
<hibernate-mapping>
<class name="edu.vt.lt.Task"
table="VT_TASKS">
<id name="id" type="long" column="TASK_ID">
<generator class="native">
<param name="sequence">TASK_ID_SEQ</param>
</generator>
</id>
<property name="owner" type="string" length="255" not-null="true">
<column name="TASK_OWNER"/>
</property>
<property name="creationDate" type="timestamp" not-null="true">
<column name="TASK_CREATION_DATE"/>
</property>
<property name="task" type="text" not-null="true">
<column name="TASK_TEXT"/>
</property>
</class>
</hibernate-mapping>
Is it possible to represent something like this in hibernate or do I just need to break down and create another object which is an id and a String? (that just seems wrong to me though)
Help?
-AZ