Exemplo n.º 1
0
 public static java.util.Iterator iterateBRADYSETByQuery(
     PersistentSession session, String condition, String orderBy) {
   StringBuffer sb = new StringBuffer("From tr.com.srdc.icardea.hibernate.BRADYSET as BRADYSET");
   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) {
     _logger.error(
         "iterateBRADYSETByQuery(PersistentSession session, String condition, String orderBy)", e);
     return null;
   }
 }
Exemplo n.º 2
0
 public static BRADYSET[] listBRADYSETByQuery(
     PersistentSession session, String condition, String orderBy) {
   StringBuffer sb = new StringBuffer("From tr.com.srdc.icardea.hibernate.BRADYSET as BRADYSET");
   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 (BRADYSET[]) list.toArray(new BRADYSET[list.size()]);
   } catch (Exception e) {
     _logger.error(
         "listBRADYSETByQuery(PersistentSession session, String condition, String orderBy)", e);
     return null;
   }
 }
Exemplo n.º 3
0
 /**
  * @param session
  * @param condition
  * @param orderBy
  * @return
  * @throws PersistentException
  */
 public CommentTask[] listCommentTaskByQuery(
     PersistentSession session, String condition, String orderBy) throws PersistentException {
   StringBuffer sb = new StringBuffer("From de.fhb.jproject.data.CommentTask as CommentTask");
   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 (CommentTask[]) list.toArray(new CommentTask[list.size()]);
   } catch (Exception e) {
     _logger.error(
         "listCommentTaskByQuery(PersistentSession session, String condition, String orderBy)", e);
     throw new PersistentException(e);
   }
 }
Exemplo n.º 4
0
 /**
  * @param session
  * @param condition
  * @param orderBy
  * @return
  * @throws PersistentException
  */
 public static java.util.Iterator iterateCommentTaskByQuery(
     PersistentSession session, String condition, String orderBy) throws PersistentException {
   StringBuffer sb = new StringBuffer("From de.fhb.jproject.data.CommentTask as CommentTask");
   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) {
     _logger.error(
         "iterateCommentTaskByQuery(PersistentSession session, String condition, String orderBy)",
         e);
     throw new PersistentException(e);
   }
 }
Exemplo n.º 5
0
 public static java.util.Iterator iterateMedicationByQuery(
     PersistentSession session,
     String condition,
     String orderBy,
     org.hibernate.LockMode lockMode) {
   StringBuffer sb =
       new StringBuffer("From tr.com.srdc.icardea.hibernate.Medication as Medication");
   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) {
     _logger.error(
         "iterateMedicationByQuery(PersistentSession session, String condition, String orderBy)",
         e);
     return null;
   }
 }
Exemplo n.º 6
0
 public static Medication[] listMedicationByQuery(
     PersistentSession session,
     String condition,
     String orderBy,
     org.hibernate.LockMode lockMode) {
   StringBuffer sb =
       new StringBuffer("From tr.com.srdc.icardea.hibernate.Medication as Medication");
   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 (Medication[]) list.toArray(new Medication[list.size()]);
   } catch (Exception e) {
     _logger.error(
         "listMedicationByQuery(PersistentSession session, String condition, String orderBy)", e);
     return null;
   }
 }