-->
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.  [ 6 posts ] 
Author Message
 Post subject: Composite-id and Date
PostPosted: Wed May 25, 2005 3:13 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
The following exception occurr when I execute quey.iterate.next() in a query to select object from the mapped table with composite keys and one of the keys beeing of type Date.

null=java.util.NoSuchElementException


The mapping is:
Code:
<hibernate-mapping>
<class name="processo.MovimentoProcesso" table="apoloes.movimento">
   <composite-id>
      <key-property name="codigoSecao" type="int">
         <column name="CODSECAO" not-null="true"/>
      </key-property>
      <key-property name="codigoProcesso" type="int">
         <column name="CODDOC" not-null="true"/>
      </key-property>
      <key-property name="dataMovimento" type="java.util.Date">
         <column name="DTHRMOV" not-null="true"/>
      </key-property>
   </composite-id>

   <property name="observacao" type="java.lang.String" >
      <column name="OBS" length="250" not-null="true"/>
   </property>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 1:51 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
java.util.NoSuchElementException:Signals that an enumeration is empty.
try iterator.hasnext() to check next item existence.


Top
 Profile  
 
 Post subject: I already use
PostPosted: Thu May 26, 2005 2:20 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
May code is of the form:

while(i.hasNext()){
i.next();
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 2:22 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
and still occur the error.

the i.hasnext returns true but i.next throws the exception


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 2:50 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
put more info. DataBase,Query, etc.


Top
 Profile  
 
 Post subject: Real problem
PostPosted: Fri May 27, 2005 11:24 am 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
Excuse-me.

there is no error.

the error was in my code and i've found him.

thanks


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