mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-21 08:24:40 +00:00
Added tests for service-layer pattern
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.iluwatar.servicelayer.spell;
|
||||
|
||||
import com.iluwatar.servicelayer.common.DaoBaseImpl;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
|
||||
import com.iluwatar.servicelayer.common.DaoBaseImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* SpellDao implementation.
|
||||
@@ -24,7 +24,6 @@ public class SpellDaoImpl extends DaoBaseImpl<Spell> implements SpellDao {
|
||||
Criteria criteria = session.createCriteria(persistentClass);
|
||||
criteria.add(Restrictions.eq("name", name));
|
||||
result = (Spell) criteria.uniqueResult();
|
||||
result.getSpellbook().getWizards().size();
|
||||
tx.commit();
|
||||
} catch (Exception e) {
|
||||
if (tx != null) {
|
||||
|
||||
Reference in New Issue
Block a user