-->
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.  [ 1 post ] 
Author Message
 Post subject: QBS or query by Example
PostPosted: Sun Jan 30, 2005 9:25 am 
Newbie

Joined: Wed Jan 19, 2005 6:41 am
Posts: 7
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp


hi
i have a table with tow peimary Key or composit-id and i want use a QBC
table Teat and class for it
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="test">
<class name="test.Test" table="test" >

<composite-id >
<key-property name="name" />
<key-property name="last" />
</composite-id>

<property name="city" not-null="true"/>
</class>

</hibernate-mapping>


i want search the table for example on field name that like to "%a%"
and use qbc but return any row
i think beacouse this field is prinar key
please tell me what use QBC for tables that i want search on primary key
example:

Test test=new Test();
test.setName("a");
Example example = Example.create(test);
example.ignoreCase();
example.excludeProperty("name");
example.enableLike(MatchMode.ANYWHERE);
Criteria criteria = session.createCriteria(Test.class);
criteria.add(example);
List list1 = criteria.list();


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