Package orm

Source Code of orm.Tmp_palabrasemanticaDAO

/**
* "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_palabrasemanticaDAO {
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByORMID(int ps_id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_palabrasemanticaByORMID(session, ps_id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica getTmp_palabrasemanticaByORMID(int ps_id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getTmp_palabrasemanticaByORMID(session, ps_id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByORMID(int ps_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_palabrasemanticaByORMID(session, ps_id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica getTmp_palabrasemanticaByORMID(int ps_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getTmp_palabrasemanticaByORMID(session, ps_id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByORMID(PersistentSession session, int ps_id) throws PersistentException {
    try {
      return (Tmp_palabrasemantica) session.load(orm.Tmp_palabrasemantica.class, new Integer(ps_id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica getTmp_palabrasemanticaByORMID(PersistentSession session, int ps_id) throws PersistentException {
    try {
      return (Tmp_palabrasemantica) session.get(orm.Tmp_palabrasemantica.class, new Integer(ps_id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByORMID(PersistentSession session, int ps_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Tmp_palabrasemantica) session.load(orm.Tmp_palabrasemantica.class, new Integer(ps_id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica getTmp_palabrasemanticaByORMID(PersistentSession session, int ps_id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Tmp_palabrasemantica) session.get(orm.Tmp_palabrasemantica.class, new Integer(ps_id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica[] listTmp_palabrasemanticaByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listTmp_palabrasemanticaByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica[] listTmp_palabrasemanticaByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listTmp_palabrasemanticaByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica[] listTmp_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_palabrasemantica as Tmp_palabrasemantica");
    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_palabrasemantica[]) list.toArray(new Tmp_palabrasemantica[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica[] listTmp_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_palabrasemantica as Tmp_palabrasemantica");
    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_palabrasemantica[]) list.toArray(new Tmp_palabrasemantica[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_palabrasemanticaByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadTmp_palabrasemanticaByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    Tmp_palabrasemantica[] tmp_palabrasemanticas = listTmp_palabrasemanticaByQuery(session, condition, orderBy);
    if (tmp_palabrasemanticas != null && tmp_palabrasemanticas.length > 0)
      return tmp_palabrasemanticas[0];
    else
      return null;
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    Tmp_palabrasemantica[] tmp_palabrasemanticas = listTmp_palabrasemanticaByQuery(session, condition, orderBy, lockMode);
    if (tmp_palabrasemanticas != null && tmp_palabrasemanticas.length > 0)
      return tmp_palabrasemanticas[0];
    else
      return null;
  }
 
  public static java.util.Iterator iterateTmp_palabrasemanticaByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iterateTmp_palabrasemanticaByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iterateTmp_palabrasemanticaByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iterateTmp_palabrasemanticaByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iterateTmp_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_palabrasemantica as Tmp_palabrasemantica");
    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_palabrasemanticaByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Tmp_palabrasemantica as Tmp_palabrasemantica");
    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_palabrasemantica createTmp_palabrasemantica() {
    return new orm.Tmp_palabrasemantica();
  }
 
  public static boolean save(orm.Tmp_palabrasemantica tmp_palabrasemantica) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().saveObject(tmp_palabrasemantica);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean delete(orm.Tmp_palabrasemantica tmp_palabrasemantica) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().deleteObject(tmp_palabrasemantica);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean deleteAndDissociate(orm.Tmp_palabrasemantica tmp_palabrasemantica)throws PersistentException {
    try {
      if(tmp_palabrasemantica.getPs_cp() != null) {
        tmp_palabrasemantica.getPs_cp().tmp_palabrasemantica.remove(tmp_palabrasemantica);
      }
     
      orm.Tmp_licitaciones_palabrasemanticas[] lTmp_licitaciones_palabrasemanticass = tmp_palabrasemantica.tmp_licitaciones_palabrasemanticas.toArray();
      for(int i = 0; i < lTmp_licitaciones_palabrasemanticass.length; i++) {
        lTmp_licitaciones_palabrasemanticass[i].setLcps_ps(null);
      }
      return delete(tmp_palabrasemantica);
    }
    catch(Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean deleteAndDissociate(orm.Tmp_palabrasemantica tmp_palabrasemantica, org.orm.PersistentSession session)throws PersistentException {
    try {
      if(tmp_palabrasemantica.getPs_cp() != null) {
        tmp_palabrasemantica.getPs_cp().tmp_palabrasemantica.remove(tmp_palabrasemantica);
      }
     
      orm.Tmp_licitaciones_palabrasemanticas[] lTmp_licitaciones_palabrasemanticass = tmp_palabrasemantica.tmp_licitaciones_palabrasemanticas.toArray();
      for(int i = 0; i < lTmp_licitaciones_palabrasemanticass.length; i++) {
        lTmp_licitaciones_palabrasemanticass[i].setLcps_ps(null);
      }
      try {
        session.delete(tmp_palabrasemantica);
        return true;
      } catch (Exception e) {
        return false;
      }
    }
    catch(Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean refresh(orm.Tmp_palabrasemantica tmp_palabrasemantica) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().refresh(tmp_palabrasemantica);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean evict(orm.Tmp_palabrasemantica tmp_palabrasemantica) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().evict(tmp_palabrasemantica);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Tmp_palabrasemantica loadTmp_palabrasemanticaByCriteria(Tmp_palabrasemanticaCriteria tmp_palabrasemanticaCriteria) {
    Tmp_palabrasemantica[] tmp_palabrasemanticas = listTmp_palabrasemanticaByCriteria(tmp_palabrasemanticaCriteria);
    if(tmp_palabrasemanticas == null || tmp_palabrasemanticas.length == 0) {
      return null;
    }
    return tmp_palabrasemanticas[0];
  }
 
  public static Tmp_palabrasemantica[] listTmp_palabrasemanticaByCriteria(Tmp_palabrasemanticaCriteria tmp_palabrasemanticaCriteria) {
    return tmp_palabrasemanticaCriteria.listTmp_palabrasemantica();
  }
}
TOP

Related Classes of orm.Tmp_palabrasemanticaDAO

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.