Package orm

Source Code of orm.PalabrasemanticasDAO

/**
* "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 PalabrasemanticasDAO {
  public static Palabrasemanticas loadPalabrasemanticasByORMID(int id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadPalabrasemanticasByORMID(session, id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas getPalabrasemanticasByORMID(int id) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getPalabrasemanticasByORMID(session, id);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByORMID(int id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadPalabrasemanticasByORMID(session, id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas getPalabrasemanticasByORMID(int id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return getPalabrasemanticasByORMID(session, id, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByORMID(PersistentSession session, int id) throws PersistentException {
    try {
      return (Palabrasemanticas) session.load(orm.Palabrasemanticas.class, new Integer(id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas getPalabrasemanticasByORMID(PersistentSession session, int id) throws PersistentException {
    try {
      return (Palabrasemanticas) session.get(orm.Palabrasemanticas.class, new Integer(id));
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByORMID(PersistentSession session, int id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Palabrasemanticas) session.load(orm.Palabrasemanticas.class, new Integer(id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas getPalabrasemanticasByORMID(PersistentSession session, int id, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      return (Palabrasemanticas) session.get(orm.Palabrasemanticas.class, new Integer(id), lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas[] listPalabrasemanticasByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listPalabrasemanticasByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas[] listPalabrasemanticasByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return listPalabrasemanticasByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas[] listPalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Palabrasemanticas as Palabrasemanticas");
    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 (Palabrasemanticas[]) list.toArray(new Palabrasemanticas[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas[] listPalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Palabrasemanticas as Palabrasemanticas");
    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 (Palabrasemanticas[]) list.toArray(new Palabrasemanticas[list.size()]);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadPalabrasemanticasByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return loadPalabrasemanticasByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    Palabrasemanticas[] palabrasemanticases = listPalabrasemanticasByQuery(session, condition, orderBy);
    if (palabrasemanticases != null && palabrasemanticases.length > 0)
      return palabrasemanticases[0];
    else
      return null;
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    Palabrasemanticas[] palabrasemanticases = listPalabrasemanticasByQuery(session, condition, orderBy, lockMode);
    if (palabrasemanticases != null && palabrasemanticases.length > 0)
      return palabrasemanticases[0];
    else
      return null;
  }
 
  public static java.util.Iterator iteratePalabrasemanticasByQuery(String condition, String orderBy) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iteratePalabrasemanticasByQuery(session, condition, orderBy);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iteratePalabrasemanticasByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    try {
      PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
      return iteratePalabrasemanticasByQuery(session, condition, orderBy, lockMode);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static java.util.Iterator iteratePalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Palabrasemanticas as Palabrasemanticas");
    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 iteratePalabrasemanticasByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From orm.Palabrasemanticas as Palabrasemanticas");
    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 Palabrasemanticas createPalabrasemanticas() {
    return new orm.Palabrasemanticas();
  }
 
  public static boolean save(orm.Palabrasemanticas palabrasemanticas) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().saveObject(palabrasemanticas);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean delete(orm.Palabrasemanticas palabrasemanticas) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().deleteObject(palabrasemanticas);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean refresh(orm.Palabrasemanticas palabrasemanticas) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().refresh(palabrasemanticas);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static boolean evict(orm.Palabrasemanticas palabrasemanticas) throws PersistentException {
    try {
      orm.MercadoPublico2PersistentManager.instance().getSession().evict(palabrasemanticas);
      return true;
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new PersistentException(e);
    }
  }
 
  public static Palabrasemanticas loadPalabrasemanticasByCriteria(PalabrasemanticasCriteria palabrasemanticasCriteria) {
    Palabrasemanticas[] palabrasemanticases = listPalabrasemanticasByCriteria(palabrasemanticasCriteria);
    if(palabrasemanticases == null || palabrasemanticases.length == 0) {
      return null;
    }
    return palabrasemanticases[0];
  }
 
  public static Palabrasemanticas[] listPalabrasemanticasByCriteria(PalabrasemanticasCriteria palabrasemanticasCriteria) {
    return palabrasemanticasCriteria.listPalabrasemanticas();
  }
}
TOP

Related Classes of orm.PalabrasemanticasDAO

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.