KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > utilities > hibernate > HibernateObjectUtil


1 /*
2  * Shark Hibernate persistent layer - Open Wide
3  */

4
5 package org.enhydra.shark.utilities.hibernate;
6
7 import java.math.BigDecimal JavaDoc;
8
9 import org.enhydra.shark.api.internal.instancepersistence.PersistenceException;
10 import org.enhydra.shark.utilities.hibernate.HibernateUtilities;
11
12 /**
13  * Simple utility class, common for all Hibernate Object classes
14  * @author Vladislav Pernin
15  */

16
17 public class HibernateObjectUtil {
18     
19     public static BigDecimal JavaDoc getNextDecId(String JavaDoc type) throws PersistenceException {
20         try {
21             return HibernateUtilities.getNext(type);
22         } catch (Exception JavaDoc e) {
23             throw new PersistenceException("Couldn't allocate id");
24         }
25     }
26
27 }
28
Popular Tags