-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: OneToMany, IndexColumn and so on..
PostPosted: Fri Dec 04, 2009 12:15 pm 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
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


Top
 Profile  
 
 Post subject: Re: OneToMany, IndexColumn and so on..
PostPosted: Fri Dec 04, 2009 12:46 pm 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Update :
- I have removed parent-pointer-plugin and now i am getting "org.hibernate.AnnotationException: No identifier specified for entity: myPackage.Task"


Top
 Profile  
 
 Post subject: Re: OneToMany, IndexColumn and so on..
PostPosted: Fri Dec 04, 2009 12:56 pm 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Update
I had removed a bit to much code. @ID is present again.
, but :
javax.persistence.PersistenceException: [PersistenceUnit: mypackage ] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

sollution is in Trace: "Could not find a setter for property XXXX"


Top
 Profile  
 
 Post subject: Re: OneToMany, IndexColumn and so on..
PostPosted: Fri Dec 04, 2009 1:06 pm 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
I have got the sollution :

The getter and setter Methodds of Parent-Pointer-Plugin with type Object nade trubbles...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.