Package orm

Source Code of orm.Tmp_resultadoprocesoDAO

/**
* "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 Tmp_resultadoprocesoDAO {
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByORMID(int rp_id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_resultadoprocesoByORMID(session, rp_id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso getTmp_resultadoprocesoByORMID(int rp_id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getTmp_resultadoprocesoByORMID(session, rp_id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByORMID(int rp_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_resultadoprocesoByORMID(session, rp_id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso getTmp_resultadoprocesoByORMID(int rp_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getTmp_resultadoprocesoByORMID(session, rp_id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByORMID(PersistentSession session, int rp_id) throws PersistentException {
    try {
      return (Tmp_resultadoproceso) session.load(orm.Tmp_resultadoproceso.class, new Integer(rp_id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso getTmp_resultadoprocesoByORMID(PersistentSession session, int rp_id) throws PersistentException {
    try {
      return (Tmp_resultadoproceso) session.get(orm.Tmp_resultadoproceso.class, new Integer(rp_id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByORMID(PersistentSession session, int rp_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Tmp_resultadoproceso) session.load(orm.Tmp_resultadoproceso.class, new Integer(rp_id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso getTmp_resultadoprocesoByORMID(PersistentSession session, int rp_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Tmp_resultadoproceso) session.get(orm.Tmp_resultadoproceso.class, new Integer(rp_id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso[] listTmp_resultadoprocesoByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listTmp_resultadoprocesoByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso[] listTmp_resultadoprocesoByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listTmp_resultadoprocesoByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso[] listTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_resultadoproceso as Tmp_resultadoproceso");
    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 (Tmp_resultadoproceso[]) list.toArray(new Tmp_resultadoproceso[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso[] listTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_resultadoproceso as Tmp_resultadoproceso");
    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 (Tmp_resultadoproceso[]) list.toArray(new Tmp_resultadoproceso[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_resultadoprocesoByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_resultadoprocesoByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    Tmp_resultadoproceso[] tmp_resultadoprocesos = listTmp_resultadoprocesoByQuery(session, condition, orderBy);
    if (tmp_resultadoprocesos != null && tmp_resultadoprocesos.length > 0)
      return tmp_resultadoprocesos[0];
    else
      return null;
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    Tmp_resultadoproceso[] tmp_resultadoprocesos = listTmp_resultadoprocesoByQuery(session, condition, orderBy, lockMode);
    if (tmp_resultadoprocesos != null && tmp_resultadoprocesos.length > 0)
      return tmp_resultadoprocesos[0];
    else
      return null;
  }
 
  public static java.util.Iterator iterateTmp_resultadoprocesoByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iterateTmp_resultadoprocesoByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iterateTmp_resultadoprocesoByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iterateTmp_resultadoprocesoByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iterateTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_resultadoproceso as Tmp_resultadoproceso");
    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 iterateTmp_resultadoprocesoByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_resultadoproceso as Tmp_resultadoproceso");
    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 Tmp_resultadoproceso createTmp_resultadoproceso() {
    return new orm.Tmp_resultadoproceso();
  }
 
  public static boolean save(orm.Tmp_resultadoproceso tmp_resultadoproceso) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().saveObject(tmp_resultadoproceso);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean delete(orm.Tmp_resultadoproceso tmp_resultadoproceso) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().deleteObject(tmp_resultadoproceso);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean deleteAndDissociate(orm.Tmp_resultadoproceso tmp_resultadoproceso)throws PersistentException {
    try {
      if(tmp_resultadoproceso.getRp_lc_id_codigo_licitacion() != null) {
        tmp_resultadoproceso.getRp_lc_id_codigo_licitacion().tmp_resultadoproceso.remove(tmp_resultadoproceso);
      }
     
      return delete(tmp_resultadoproceso);
    }
    catch(Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean deleteAndDissociate(orm.Tmp_resultadoproceso tmp_resultadoproceso, org.orm.PersistentSession session)throws PersistentException {
    try {
      if(tmp_resultadoproceso.getRp_lc_id_codigo_licitacion() != null) {
        tmp_resultadoproceso.getRp_lc_id_codigo_licitacion().tmp_resultadoproceso.remove(tmp_resultadoproceso);
      }
     
      try {
        session.delete(tmp_resultadoproceso);
        return true;
      } catch (Exception e) {
        return false;
      }
    }
    catch(Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean refresh(orm.Tmp_resultadoproceso tmp_resultadoproceso) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().refresh(tmp_resultadoproceso);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean evict(orm.Tmp_resultadoproceso tmp_resultadoproceso) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().evict(tmp_resultadoproceso);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_resultadoproceso loadTmp_resultadoprocesoByCriteria(Tmp_resultadoprocesoCriteria tmp_resultadoprocesoCriteria) {
    Tmp_resultadoproceso[] tmp_resultadoprocesos = listTmp_resultadoprocesoByCriteria(tmp_resultadoprocesoCriteria);
    if(tmp_resultadoprocesos == null || tmp_resultadoprocesos.length == 0) {
      return null;
    }
    return tmp_resultadoprocesos[0];
  }
 
  public static Tmp_resultadoproceso[] listTmp_resultadoprocesoByCriteria(Tmp_resultadoprocesoCriteria tmp_resultadoprocesoCriteria) {
    return tmp_resultadoprocesoCriteria.listTmp_resultadoproceso();
  }
}
TOP

Related Classes of orm.Tmp_resultadoprocesoDAO

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.