/**
* "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_userbackendDAO {
public static Tau_userbackend loadTau_userbackendByORMID(int ub_id) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userbackendByORMID(session, ub_id);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend getTau_userbackendByORMID(int ub_id) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return getTau_userbackendByORMID(session, ub_id);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByORMID(int ub_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userbackendByORMID(session, ub_id, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend getTau_userbackendByORMID(int ub_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return getTau_userbackendByORMID(session, ub_id, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByORMID(PersistentSession session, int ub_id) throws PersistentException {
try {
return (Tau_userbackend) session.load(orm.Tau_userbackend.class, new Integer(ub_id));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend getTau_userbackendByORMID(PersistentSession session, int ub_id) throws PersistentException {
try {
return (Tau_userbackend) session.get(orm.Tau_userbackend.class, new Integer(ub_id));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByORMID(PersistentSession session, int ub_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tau_userbackend) session.load(orm.Tau_userbackend.class, new Integer(ub_id), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend getTau_userbackendByORMID(PersistentSession session, int ub_id, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tau_userbackend) session.get(orm.Tau_userbackend.class, new Integer(ub_id), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend[] listTau_userbackendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return listTau_userbackendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend[] listTau_userbackendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return listTau_userbackendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend[] listTau_userbackendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userbackend as Tau_userbackend");
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_userbackend[]) list.toArray(new Tau_userbackend[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend[] listTau_userbackendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userbackend as Tau_userbackend");
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_userbackend[]) list.toArray(new Tau_userbackend[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userbackendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return loadTau_userbackendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
Tau_userbackend[] tau_userbackends = listTau_userbackendByQuery(session, condition, orderBy);
if (tau_userbackends != null && tau_userbackends.length > 0)
return tau_userbackends[0];
else
return null;
}
public static Tau_userbackend loadTau_userbackendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
Tau_userbackend[] tau_userbackends = listTau_userbackendByQuery(session, condition, orderBy, lockMode);
if (tau_userbackends != null && tau_userbackends.length > 0)
return tau_userbackends[0];
else
return null;
}
public static java.util.Iterator iterateTau_userbackendByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return iterateTau_userbackendByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTau_userbackendByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.AuthPersistentManager.instance().getSession();
return iterateTau_userbackendByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTau_userbackendByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userbackend as Tau_userbackend");
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_userbackendByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tau_userbackend as Tau_userbackend");
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_userbackend createTau_userbackend() {
return new orm.Tau_userbackend();
}
public static boolean save(orm.Tau_userbackend tau_userbackend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().saveObject(tau_userbackend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean delete(orm.Tau_userbackend tau_userbackend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().deleteObject(tau_userbackend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tau_userbackend tau_userbackend)throws PersistentException {
try {
orm.Tau_sessionuserbackend[] lTau_sessionuserbackends = tau_userbackend.tau_sessionuserbackend.toArray();
for(int i = 0; i < lTau_sessionuserbackends.length; i++) {
lTau_sessionuserbackends[i].setSb_ub(null);
}
return delete(tau_userbackend);
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tau_userbackend tau_userbackend, org.orm.PersistentSession session)throws PersistentException {
try {
orm.Tau_sessionuserbackend[] lTau_sessionuserbackends = tau_userbackend.tau_sessionuserbackend.toArray();
for(int i = 0; i < lTau_sessionuserbackends.length; i++) {
lTau_sessionuserbackends[i].setSb_ub(null);
}
try {
session.delete(tau_userbackend);
return true;
} catch (Exception e) {
return false;
}
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean refresh(orm.Tau_userbackend tau_userbackend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().getSession().refresh(tau_userbackend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean evict(orm.Tau_userbackend tau_userbackend) throws PersistentException {
try {
orm.AuthPersistentManager.instance().getSession().evict(tau_userbackend);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tau_userbackend loadTau_userbackendByCriteria(Tau_userbackendCriteria tau_userbackendCriteria) {
Tau_userbackend[] tau_userbackends = listTau_userbackendByCriteria(tau_userbackendCriteria);
if(tau_userbackends == null || tau_userbackends.length == 0) {
return null;
}
return tau_userbackends[0];
}
public static Tau_userbackend[] listTau_userbackendByCriteria(Tau_userbackendCriteria tau_userbackendCriteria) {
return tau_userbackendCriteria.listTau_userbackend();
}
}