db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Barre <Guillaume.Ba...@technomedia.ca>
Subject Problem with Date in Criteria
Date Wed, 04 Jun 2003 19:34:30 GMT
Hello,

I try to use one Date object in a Criteria like in the code below :

	
Iterator iterator1 = TqEntrepriseTypePeer.doSelect(new
Criteria()).iterator();
while(iterator1.hasNext()){
	TqEntrepriseType obj1 = (TqEntrepriseType)iterator1.next();

	System.out.println("getId " + obj1.getId());
	System.out.println("date " + obj1.getAuLastUpdateDate());
	
	Criteria criteria2 = new Criteria();	
	criteria2.add(TqEntrepriseTypePeer.AU_LAST_UPDATE_DATE,
obj.getAuLastUpdateDate() );
	Iterator iterator2 =
TqEntrepriseTypePeer.doSelect(criteria2).iterator();
	while(iterator2.hasNext()){
		TqEntrepriseType obj2 = (TqEntrepriseType)iterator2.next();

		System.out.println("getId(2) " + obj2.getId());
		System.out.println("date " + obj2.getAuLastUpdateDate());
	}
}

My problem is that this code never find the second object "obj2", iterator2
is always empty ???

Notes :
	- obj.getAuLastUpdateDate() return a java.util.Date object

	- My shcema definition for the field AuLastUpdateDate is :
	<column javaName="AuLastUpdateDate" name="AU_LAST_UPDATE_DATE"
required="false" type="TIMESTAMP"/>

	- And I use MSSQL Server

Thanks for any suggestions.
Guillaume


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message