Package org.uengine.util.dao

Examples of org.uengine.util.dao.IDAO.select()


 
  public static int getCurrnetRunningCount(TransactionContext tc,String defVerId,String tracingTag) throws Exception {
    IDAO dao = (IDAO)ConnectiveDAO.createDAOImpl(tc, currnetRunningCount_SQL, IDAO.class);
    dao.set("defVerId", defVerId);
    dao.set("tracingTag", tracingTag);
    dao.select();
    if(dao.next()){
      return ((Number)dao.get("CNT")).intValue();
    }
   
    return 0;
View Full Code Here


   
  protected Map retreiveTargetStartingPoints() throws Exception{
    Map targetKeys = new HashMap();
   
    IDAO targetKeysDAO = GenericDAO.createDAOImpl(getTargetConnectionFactory(), SQL_RETREIVETARGETSTARTINGPOINTS, IDAO.class);
    targetKeysDAO.select();
    if(targetKeysDAO.size() ==0) throw new UEngineException("Failed to retreive starting points from source server: No rows are returned.");
   
    while(targetKeysDAO.next()){
      Date recentModified = (Date)targetKeysDAO.get("recentModified");
      Number lastKey = (Number)targetKeysDAO.get("lastkey");
View Full Code Here

     * Retreives the source data first.
     */
   
    IDAO sourceDAO = GenericDAO.createDAOImpl(getSourceConnectionFactory(), SQL_RETREIVE_SOURCE, IDAO.class);
    sourceDAO.set("key", startingKey);
    sourceDAO.select();
   
    AbstractGenericDAO implSourceDAO = (AbstractGenericDAO)sourceDAO.getImplementationObject();
   
    /**
     * Change the connection information of the source data in order to store to the target server.
View Full Code Here

      System.out.print("  . "+ keyFieldName +"=["+ sourceDAO.get(keyFieldName) + "]");

      // this will check if the source value already exists
      IDAO testDAO = ConnectiveDAO.createDAOImpl(targetConnectionFactoryInTransaction, "select 1 from " + objectName + " where " + keyFieldName +" = ?key", IDAO.class);
      testDAO.set("key", sourceDAO.get(keyFieldName));
      testDAO.select();

      if(testDAO.size() > 0){
        implSourceDAO.setSqlStmt(updateSql);
        System.out.println(" [UPDATE]" + sourceDAO);
      }else{
View Full Code Here

    return "Oracle";
  }

  public Calendar getNow() throws Exception {
    IDAO nowQuery = (IDAO)create(IDAO.class, "SELECT TO_CHAR( SYSDATE , 'YYYYMMDDHH24MISS' ) as NOW from dual");
    nowQuery.select();
   
    if(nowQuery.next()){
      Calendar now = Calendar.getInstance();
     
      String dateTimeStr = (String)nowQuery.get("NOW");
View Full Code Here

          IDAO gdao = ConnectiveDAO.createDAOImpl(
              getConnectionFactory(),
              "select isNull(max(seq),0) + 1 as lastKey from bpm_seq where tbname = '" + forTableName + "'",
              IDAO.class
            );
            gdao.select();
            if(gdao.next()){
              Number currKey = (Number)gdao.get("lastKey");
            key = new Long(currKey.longValue());
            } else {
              key = new Long(1);
View Full Code Here

  }
 
  public Calendar getNow() throws Exception {
    //IDAO nowQuery = (IDAO)create(IDAO.class, "select convert(varchar(10), getdate(), 120) as now");
    IDAO nowQuery = (IDAO)create(IDAO.class, "select getdate() as now");
    nowQuery.select();
   
    if(nowQuery.next()){
      Calendar now = Calendar.getInstance();
      now.setTime((Date)nowQuery.get("now"));
     
View Full Code Here

      dao.getImplementationObject().setKeyField(keyFieldName);
      dao.set(keyFieldName, keyFieldValue);

      if(!isNew){
        dao.getImplementationObject().createSelectSql();
        dao.select();
        if(!dao.next()) throw new UEngineException("No Such "+tableName+" where "+keyFieldName+" is " + keyFieldValue);
      }
     
      String sharedContextKey = tableName + "@" + keyFieldValue;
      sharedContextKey = sharedContextKey.toUpperCase();
View Full Code Here

          sql = sql + " with ur";
       
        dao = ConnectiveDAO.createDAOImpl(instance.getProcessTransactionContext(), sql, IDAO.class);
       
        dao.set(getCorrelationFieldName(), keyValue);
        dao.select();

        if(dao.next()){
          instance.getProcessTransactionContext().setSharedContext(sharedContextKey, dao);
        }else
          return null;
View Full Code Here

            IDAO.class
        );
       
        roleUser.set("roleCode", getRoleId());
        roleUser.set("groupCode", getGroupId());
        roleUser.select();
      } else if ( getReferenceRole() != null && getReferenceRole().getMapping(instance) != null ) {
        roleUser = GenericDAO.createDAOImpl(
            DefaultConnectionFactory.create(),
            "select R.EMPCODE from EMPTABLE E, (select PARTCODE, EMPCODE from EMPTABLE where EMPCODE= ?empCode) T, ROLEUSERTABLE R where E.ISDELETED='0' and E.PARTCODE =  T.PARTCODE and R.ROLECODE = ?roleCode and R.EMPCODE = E.EMPCODE ",
            IDAO.class
View Full Code Here

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.