/**
* "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_licitacionDAO {
public static Tmp_licitacion loadTmp_licitacionByORMID(int lc_id_codigo_licitacion) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return loadTmp_licitacionByORMID(session, lc_id_codigo_licitacion);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion getTmp_licitacionByORMID(int lc_id_codigo_licitacion) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return getTmp_licitacionByORMID(session, lc_id_codigo_licitacion);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByORMID(int lc_id_codigo_licitacion, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return loadTmp_licitacionByORMID(session, lc_id_codigo_licitacion, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion getTmp_licitacionByORMID(int lc_id_codigo_licitacion, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return getTmp_licitacionByORMID(session, lc_id_codigo_licitacion, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByORMID(PersistentSession session, int lc_id_codigo_licitacion) throws PersistentException {
try {
return (Tmp_licitacion) session.load(orm.Tmp_licitacion.class, new Integer(lc_id_codigo_licitacion));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion getTmp_licitacionByORMID(PersistentSession session, int lc_id_codigo_licitacion) throws PersistentException {
try {
return (Tmp_licitacion) session.get(orm.Tmp_licitacion.class, new Integer(lc_id_codigo_licitacion));
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByORMID(PersistentSession session, int lc_id_codigo_licitacion, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tmp_licitacion) session.load(orm.Tmp_licitacion.class, new Integer(lc_id_codigo_licitacion), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion getTmp_licitacionByORMID(PersistentSession session, int lc_id_codigo_licitacion, org.hibernate.LockMode lockMode) throws PersistentException {
try {
return (Tmp_licitacion) session.get(orm.Tmp_licitacion.class, new Integer(lc_id_codigo_licitacion), lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion[] listTmp_licitacionByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return listTmp_licitacionByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion[] listTmp_licitacionByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return listTmp_licitacionByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion[] listTmp_licitacionByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tmp_licitacion as Tmp_licitacion");
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_licitacion[]) list.toArray(new Tmp_licitacion[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion[] listTmp_licitacionByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tmp_licitacion as Tmp_licitacion");
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_licitacion[]) list.toArray(new Tmp_licitacion[list.size()]);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return loadTmp_licitacionByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return loadTmp_licitacionByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
Tmp_licitacion[] tmp_licitacions = listTmp_licitacionByQuery(session, condition, orderBy);
if (tmp_licitacions != null && tmp_licitacions.length > 0)
return tmp_licitacions[0];
else
return null;
}
public static Tmp_licitacion loadTmp_licitacionByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
Tmp_licitacion[] tmp_licitacions = listTmp_licitacionByQuery(session, condition, orderBy, lockMode);
if (tmp_licitacions != null && tmp_licitacions.length > 0)
return tmp_licitacions[0];
else
return null;
}
public static java.util.Iterator iterateTmp_licitacionByQuery(String condition, String orderBy) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return iterateTmp_licitacionByQuery(session, condition, orderBy);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTmp_licitacionByQuery(String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
try {
PersistentSession session = orm.MercadoPublico2PersistentManager.instance().getSession();
return iterateTmp_licitacionByQuery(session, condition, orderBy, lockMode);
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static java.util.Iterator iterateTmp_licitacionByQuery(PersistentSession session, String condition, String orderBy) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tmp_licitacion as Tmp_licitacion");
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_licitacionByQuery(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException {
StringBuffer sb = new StringBuffer("From orm.Tmp_licitacion as Tmp_licitacion");
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_licitacion createTmp_licitacion() {
return new orm.Tmp_licitacion();
}
public static boolean save(orm.Tmp_licitacion tmp_licitacion) throws PersistentException {
try {
orm.MercadoPublico2PersistentManager.instance().saveObject(tmp_licitacion);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean delete(orm.Tmp_licitacion tmp_licitacion) throws PersistentException {
try {
orm.MercadoPublico2PersistentManager.instance().deleteObject(tmp_licitacion);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tmp_licitacion tmp_licitacion)throws PersistentException {
try {
orm.Tmp_licitaciones_palabrasemanticas[] lTmp_licitaciones_palabrasemanticass = tmp_licitacion.tmp_licitaciones_palabrasemanticas.toArray();
for(int i = 0; i < lTmp_licitaciones_palabrasemanticass.length; i++) {
lTmp_licitaciones_palabrasemanticass[i].setLcps_lc_id_codigo_licitacion(null);
}
orm.Tmp_resultadoproceso[] lTmp_resultadoprocesos = tmp_licitacion.tmp_resultadoproceso.toArray();
for(int i = 0; i < lTmp_resultadoprocesos.length; i++) {
lTmp_resultadoprocesos[i].setRp_lc_id_codigo_licitacion(null);
}
orm.Tmp_producto[] lTmp_productos = tmp_licitacion.tmp_producto.toArray();
for(int i = 0; i < lTmp_productos.length; i++) {
lTmp_productos[i].setPr_lc_id_codigo_licitacion(null);
}
return delete(tmp_licitacion);
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean deleteAndDissociate(orm.Tmp_licitacion tmp_licitacion, org.orm.PersistentSession session)throws PersistentException {
try {
orm.Tmp_licitaciones_palabrasemanticas[] lTmp_licitaciones_palabrasemanticass = tmp_licitacion.tmp_licitaciones_palabrasemanticas.toArray();
for(int i = 0; i < lTmp_licitaciones_palabrasemanticass.length; i++) {
lTmp_licitaciones_palabrasemanticass[i].setLcps_lc_id_codigo_licitacion(null);
}
orm.Tmp_resultadoproceso[] lTmp_resultadoprocesos = tmp_licitacion.tmp_resultadoproceso.toArray();
for(int i = 0; i < lTmp_resultadoprocesos.length; i++) {
lTmp_resultadoprocesos[i].setRp_lc_id_codigo_licitacion(null);
}
orm.Tmp_producto[] lTmp_productos = tmp_licitacion.tmp_producto.toArray();
for(int i = 0; i < lTmp_productos.length; i++) {
lTmp_productos[i].setPr_lc_id_codigo_licitacion(null);
}
try {
session.delete(tmp_licitacion);
return true;
} catch (Exception e) {
return false;
}
}
catch(Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean refresh(orm.Tmp_licitacion tmp_licitacion) throws PersistentException {
try {
orm.MercadoPublico2PersistentManager.instance().getSession().refresh(tmp_licitacion);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static boolean evict(orm.Tmp_licitacion tmp_licitacion) throws PersistentException {
try {
orm.MercadoPublico2PersistentManager.instance().getSession().evict(tmp_licitacion);
return true;
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}
}
public static Tmp_licitacion loadTmp_licitacionByCriteria(Tmp_licitacionCriteria tmp_licitacionCriteria) {
Tmp_licitacion[] tmp_licitacions = listTmp_licitacionByCriteria(tmp_licitacionCriteria);
if(tmp_licitacions == null || tmp_licitacions.length == 0) {
return null;
}
return tmp_licitacions[0];
}
public static Tmp_licitacion[] listTmp_licitacionByCriteria(Tmp_licitacionCriteria tmp_licitacionCriteria) {
return tmp_licitacionCriteria.listTmp_licitacion();
}
}