public class TransactionDAO extends Transaction {
private static final long serialVersionUID = 1889088390110940280L;
public static Transaction load(String siteId, Long tranId) throws SecurityException, Exception {
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
Transaction transaction = (Transaction) em.find(Transaction.class, tranId);
if (!transaction.getSiteId().equals(siteId)) {
throw new SecurityException();
}
return transaction;
}