Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Is there an idNe for restrictions?
PostPosted: Wed Apr 18, 2012 2:51 pm 
Newbie

Joined: Wed Apr 18, 2012 2:34 pm
Posts: 1
http://docs.jboss.org/hibernate/core/4. ... tions.html

Why would you ever create a id equals and not a id not equals? Even in microprogramming on the processors have these two very basic functionality aspects.

I have found alot of things that have made using hibernate very very disappointing experience and much harder than writing my own sql and just using spring jdbc template to get the connection pooling and throw away the ORM part of this package to build my own.

Unless I missing something? I have a table A, A_TYPE_ID column with a type table A_TYPE(id, name). I am trying to get everything from table A where A_TYPE_ID <> ID.

I have tried the following, i honestly don't know why i can't just use query.add(session.createCritera(AType.class).add(Example.create(AType))) and it should be able to determine the relationship from the mapping file. Anyways any ideas?

This one doesn't actually restrict anything but compiles and runs.
Code:
query.createCriteria("aType").add(Restrictions.ne("id", id));

Code:
query.add(Restrictions.ne("aTypeId", 2L));

Code:
query.add(Restrictions.ne("aType", 2L));


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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.