-->
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.  [ 2 posts ] 
Author Message
 Post subject: getID method returns null
PostPosted: Wed Jan 23, 2008 8:50 am 
Newbie

Joined: Wed Jan 23, 2008 8:36 am
Posts: 4
Dear All,

if i load records from oracle 10g database via hibernate3 the VO object returns for the primary key field called "ID" null value. If i see the table via the admin console the id's have values. Other fields from the records are ok, i can get theirs value via VO objects.

Why the ID is null from VO object? What could cause this?

the find method, as we see, the entity Object has the values from ID-s but if i convert them to VO object, the ID-s will be null:
Code:
    protected hu.unitis.flexsign.signmanagement.SignManagerVO[] handleFindSigned(int criteria)
        throws java.lang.Exception
    {
        // @todo implement protected hu.unitis.flexsign.signmanagement.SignManagerVO[] handleFindSigned(hu.unitis.flexsign.signmanagement.SignManagerSearchCriteriaVO criteria)
        Collection smCriteria = this.getSignManagerDao().findByCriteria(criteria);
        Iterator iter = smCriteria.iterator();
        while ( iter.hasNext() ){
            Object iterObj = iter.next();
            System.out.println( "ResultSet item: " + iterObj.getClass().getName() );
            SignManagerImpl impl = (SignManagerImpl) iterObj;
            System.out.println( "Entity ID: " + impl.getId());
          }
        this.getSignManagerDao().toSignManagerVOCollection(smCriteria);
        Iterator iter2 = smCriteria.iterator();
        while ( iter2.hasNext() ){
            Object iterObj = iter2.next();
            System.out.println( "ResultSet item: " + iterObj.getClass().getName() );
            SignManagerVO implVO = (SignManagerVO) iterObj;
            System.out.println( "VO ID: " + implVO.getID());
          }
        return (SignManagerVO[])smCriteria.toArray(new SignManagerVO[0]);
    }


the result on the console:
Code:
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 36
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 39
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 47
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 49
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 44
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 35
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 43
14:59:16,249 INFO  [STDOUT] ResultSet item: hu.unitis.flexsign.signmanagement.SignManagerImpl
14:59:16,249 INFO  [STDOUT] Entity ID: 37
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null
14:59:16,265 INFO  [STDOUT] VOCollection item: hu.unitis.flexsign.signmanagement.SignManagerVO
14:59:16,265 INFO  [STDOUT] VO ID: null


Thanks in advance


Last edited by aczuczor on Tue Jan 29, 2008 5:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 5:17 am 
Newbie

Joined: Wed Jan 23, 2008 8:36 am
Posts: 4
I set the VO id again then it worked. Hmm.. i found some topics where the solution was that the ID's multiplicity should be set to [0..1] but it didn't worked for me.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.