Hello All :)
I am new to Hibernate, but I am SQL profi since DB2 7.2 in the jear 2000.
My Target is to patch Hyperhaxb3 generated sources for Hybernate 3.3.2 to providing @IndexColumn for 1-N handling using Hibernate 3.4 annotations..
There is a requirement that no extra/not-needed N-M AssoziationTables should be created.
I have Understand IndexColumn and configured right, I think, but now i ran into "property mapping has wrong number of columns: myPackageName.Task.parent type: object:" .. error when building EntityManagerFactory..
Shure this mapping error is posted much than often without anwers, but may somebody has a litle time to view this simple source:
This here is my first step into hibernate and I would be such happy to work with it.
Parent (TaskS)
Code:
public class Tasks implements Equals, HashCode, ToString
{
@XmlElement(name = "Task", required = true)
protected List<myPackageName.Task> task;
@OneToMany( cascade = { CascadeType.ALL} , fetch = FetchType.EAGER )
@JoinColumn( name = "TASKS_ID" )
@org.hibernate.annotations.Cascade( value=org.hibernate.annotations.CascadeType.DELETE_ORPHAN )
@IndexColumn( name = "INDEX")
public List<myPackageName.Task> getTask() {
if (task == null) {
task = new ArrayList<myPackageName.Task>();
}
return this.task;
}
Child :
Code:
public class Task implements Equals, HashCode, ToString, Child /*ppp*/
{
@XmlElement(name = "Test1", required = true)
protected String test1;
@XmlTransient
@ManyToOne
@JoinColumn( name="TASK_ID" , nullable=false , updatable=false , insertable=false )
private myPackageName.Tasks parent;
}
any help welcome, if solution is available I will report.
Regards, Greats, Andre from Berlin