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