I'm having a problem saving an object that uses an Array. I know arrays are bad, but I need a strongly typed collection. Here's what things look like.
The parent object (Plan)
Code:
/**
* @hibernate.array role="getGoals" cascade="save-update"
* @hibernate.collection-index column="GOAL_ID"
* @hibernate.collection-key column="PLAN_ID"
* @hibernate.collection-one-to-many class="com.ebiz.bom.soap.Goal"
*
*/
public Goal[] getGoals()
{
return goals;
}
The child object (Goal)
Code:
/**
* @hibernate.many-to-one column="PLAN_ID" class="com.ebiz.bom.soap.Plan" cascade="none"
*
* @return Plan
*
*/
public Plan getPlan()
{
return plan;
}
Everything seems to work fine until I try and save the Plan object. At that point I get several queries that are fine then something like this:
[STDOUT] Hibernate: update GOALS set PLAN_ID=null, GOAL_ID=null where PLAN_ID=?
Then obviously I get a few exceptions. None of the Goal[] array object are null, and I'm completely lost at this point.
I'm running the latest Hibernate on JBoss 3.2.3 & MySQL ver 4.