Once again the problem is in the developer :) The mapping file states that my Example table has a primary key which in turn is not true. Problem solved! Thanks to all.
Schmidt wrote: > > Hi, > > I'm facing a strange problem when dealing with queryByExample. The source > code below has been changed to simplify my question. > > Example e = new Example(); > e.setSomeCode(48888); > QueryByCriteria criteriaQuery = QueryFactory.newQueryByExample(e); > this.getPersistenceBrokerTemplate().getCollectionByQuery(criteriaQuery); > > The expected behavior is to get a collection of objects whose attribute > 'someCode' is equal to 48888, but somehow I'm getting some objects with > 'someCode'=48888 and others with 'someCode'=48642 and others with > 'someCode'=48661. How? > > The generated SQL is also ok > SELECT * FROM EXAMPLE A0 WHERE A0.SOMECODE = ? > > Does someone here have ever experienced something like this? > > -- View this message in context: http://www.nabble.com/Wrong-results-using-queryByExample-tp16744000p16744017.html Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]