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();