/**
* "Visual Paradigm: DO NOT MODIFY THIS FILE!"
*
* This is an automatic generated file. It will be regenerated every time
* you generate persistence class.
*
* Modifying its content may cause the program not work, or your work may lost.
*/
/**
* Licensee: DuKe TeAm
* License Type: Purchased
*/
package orm;
import org.orm.*;
import org.hibernate.Query;
import java.util.List;
public class Tau_userfrontendDAO {
public static Tau_userfrontend loadTau_userfrontendByORMID(int uf_id) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userfrontendByORMID(session, uf_id);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend getTau_userfrontendByORMID(int uf_id) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return getTau_userfrontendByORMID(session, uf_id);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByORMID(int uf_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userfrontendByORMID(session, uf_id, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend getTau_userfrontendByORMID(int uf_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return getTau_userfrontendByORMID(session, uf_id, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByORMID(PersistentSession session, int uf_id) throws PersistentException {
try {
return (Tau_userfrontend) session.load(orm.Tau_userfrontend.class, new Integer(uf_id));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend getTau_userfrontendByORMID(PersistentSession session, int uf_id) throws PersistentException {
try {
return (Tau_userfrontend) session.get(orm.Tau_userfrontend.class, new Integer(uf_id));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByORMID(PersistentSession session, int uf_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tau_userfrontend) session.load(orm.Tau_userfrontend.class, new Integer(uf_id), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend getTau_userfrontendByORMID(PersistentSession session, int uf_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tau_userfrontend) session.get(orm.Tau_userfrontend.class, new Integer(uf_id), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend[] listTau_userfrontendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return listTau_userfrontendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend[] listTau_userfrontendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return listTau_userfrontendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend[] listTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userfrontend as Tau_userfrontend");
if (condition != null)
sb.append(" Where ").append(condition);
if (orderBy != null)
sb.append(" Order By ").append(orderBy);
try {
Query query = session.createQuery(sb.toString());
List list = query.list();
return (Tau_userfrontend[]) list.toArray(new Tau_userfrontend[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend[] listTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userfrontend as Tau_userfrontend");
if (condition != null)
sb.append(" Where ").append(condition);
if (orderBy != null)
sb.append(" Order By ").append(orderBy);
try {
Query query = session.createQuery(sb.toString());
query.setLockMode("this", lockMode);
List list = query.list();
return (Tau_userfrontend[]) list.toArray(new Tau_userfrontend[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userfrontendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userfrontendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
Tau_userfrontend[] tau_userfrontends = listTau_userfrontendByQuery(session, condition, orderBy);
if (tau_userfrontends != null && tau_userfrontends.length > 0)
return tau_userfrontends[0];
else
return null;
}
public static Tau_userfrontend loadTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
Tau_userfrontend[] tau_userfrontends = listTau_userfrontendByQuery(session, condition, orderBy, lockMode);
if (tau_userfrontends != null && tau_userfrontends.length > 0)
return tau_userfrontends[0];
else
return null;
}
public static java.util.Iterator iterateTau_userfrontendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return iterateTau_userfrontendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTau_userfrontendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return iterateTau_userfrontendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userfrontend as Tau_userfrontend");
if (condition != null)
sb.append(" Where ").append(condition);
if (orderBy != null)
sb.append(" Order By ").append(orderBy);
try {
Query query = session.createQuery(sb.toString());
return query.iterate();
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTau_userfrontendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userfrontend as Tau_userfrontend");
if (condition != null)
sb.append(" Where ").append(condition);
if (orderBy != null)
sb.append(" Order By ").append(orderBy);
try {
Query query = session.createQuery(sb.toString());
query.setLockMode("this", lockMode);
return query.iterate();
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend createTau_userfrontend() {
return new orm.Tau_userfrontend();
}
public static boolean save(orm.Tau_userfrontend tau_userfrontend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().saveObject(tau_userfrontend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean delete(orm.Tau_userfrontend tau_userfrontend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().deleteObject(tau_userfrontend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tau_userfrontend tau_userfrontend)throws PersistentException {
try {
orm.Tau_sessionuserfrontend[] lTau_sessionuserfrontends = tau_userfrontend.tau_sessionuserfrontend.toArray();
for(int i = 0; i < lTau_sessionuserfrontends.length; i++) {
lTau_sessionuserfrontends[i].setSf_uf(null);
}
return delete(tau_userfrontend);
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tau_userfrontend tau_userfrontend, org.orm.PersistentSession session)throws PersistentException {
try {
orm.Tau_sessionuserfrontend[] lTau_sessionuserfrontends = tau_userfrontend.tau_sessionuserfrontend.toArray();
for(int i = 0; i < lTau_sessionuserfrontends.length; i++) {
lTau_sessionuserfrontends[i].setSf_uf(null);
}
try {
session.delete(tau_userfrontend);
return true;
} catch (Exception e) {
return false;
}
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean refresh(orm.Tau_userfrontend tau_userfrontend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().getSession().refresh(tau_userfrontend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean evict(orm.Tau_userfrontend tau_userfrontend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().getSession().evict(tau_userfrontend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userfrontend loadTau_userfrontendByCriteria(Tau_userfrontendCriteria tau_userfrontendCriteria) {
Tau_userfrontend[] tau_userfrontends = listTau_userfrontendByCriteria(tau_userfrontendCriteria);
if(tau_userfrontends == null || tau_userfrontends.length == 0) {
return null;
}
return tau_userfrontends[0];
}
public static Tau_userfrontend[] listTau_userfrontendByCriteria(Tau_userfrontendCriteria tau_userfrontendCriteria) {
return tau_userfrontendCriteria.listTau_userfrontend();
}
}