1 package org.hibernate.criterion; 3 4 import org.hibernate.Criteria; 5 import org.hibernate.HibernateException; 6 import org.hibernate.engine.TypedValue; 7 8 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 toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { 20 return conjunction.toSqlString(criteria, criteriaQuery); 21 } 22 23 public NaturalIdentifier set(String property, Object value) { 24 conjunction.add( Restrictions.eq(property, value) ); 25 return this; 26 } 27 28 } 29 | Popular Tags |