The Artima Developer Community
Sponsored Link

Java Answers Forum
Hibernate - Criteria

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
tiborm

Posts: 1
Nickname: tibor13
Registered: Jun, 2004

Hibernate - Criteria Posted: Jun 14, 2004 4:20 AM
Reply to this message Reply
Advertisement
Hi,


Iam using Hibernate's Criteria for DB select's.
How can I execute 'select * from Object1 where id=4 or id=5'
- I cant add a simple 'OR condition' :-(


Thank's,

Tibor



public static void main(String[] args) throws Exception {
Criteria crit = session.createCriteria( Object1.class);
crit.add( Expression.eq( "id", new Long( 4)));
//????
System.out.print( "list size: " + crit.list().size());
}

Topic: Blojsom and news/RSS feeds? Previous Topic   Next Topic Topic: FindBug tool --converting xml to html repoting format etc.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use