blob: 0beaab068ede88095e2b501e1021134489dc5bdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package org.fedoraproject.candlepin.model;
import javax.persistence.EntityManager;
import org.hibernate.criterion.Restrictions;
public class ProductRepository extends AbstractHibernateRepository<Product> {
public ProductRepository(EntityManager em) {
super(Product.class);
}
public Product lookupByName(String name) {
return (Product) currentSession().createCriteria(Product.class)
.add(Restrictions.like("name", name))
.uniqueResult();
}
public Product lookupByLabel(String label) {
return (Product) currentSession().createCriteria(Product.class)
.add(Restrictions.like("label", label))
.uniqueResult();
}
}
|