KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > criterion > NaturalIdentifier


1 //$Id: NaturalIdentifier.java,v 1.1 2005/05/25 01:22:05 oneovthafew Exp $
2
package org.hibernate.criterion;
3
4 import org.hibernate.Criteria;
5 import org.hibernate.HibernateException;
6 import org.hibernate.engine.TypedValue;
7
8 /**
9  * @author Gavin King
10  */

11 public class NaturalIdentifier implements Criterion {
12         
13     private Junction conjunction = new Conjunction();
14
15     public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
16         return conjunction.getTypedValues(criteria, criteriaQuery);
17     }
18
19     public String JavaDoc toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
20         return conjunction.toSqlString(criteria, criteriaQuery);
21     }
22     
23     public NaturalIdentifier set(String JavaDoc property, Object JavaDoc value) {
24         conjunction.add( Restrictions.eq(property, value) );
25         return this;
26     }
27
28 }
29
Popular Tags