예제 #1
0
  /**
   * Get PO Class Instance
   *
   * @param ctx
   * @param tableName
   * @param rs result set
   * @param trxName transaction
   * @return PO for Record; never return null
   */
  public PO getPO(final Properties ctx, final String tableName, ResultSet rs, String trxName) {
    final PO po = retrievePO(ctx, tableName, rs, trxName);

    final IModelCacheService modelCacheService = Services.get(IModelCacheService.class);
    modelCacheService.addToCache(po);

    return po;
  }
예제 #2
0
  /**
   * Get PO class instance
   *
   * @param whereClause
   * @param params
   * @param trxName
   * @return
   */
  public PO getPO(
      final Properties ctx,
      final String tableName,
      String whereClause,
      Object[] params,
      String trxName) {
    final PO po = retrievePO(ctx, tableName, whereClause, params, trxName);
    if (po != null) {
      final IModelCacheService modelCacheService = Services.get(IModelCacheService.class);
      modelCacheService.addToCache(po);
    }

    return po;
  }
예제 #3
0
  /**
   * @param Record_ID
   * @param checkCache true if object shall be checked in cache first
   * @param trxName
   * @return loaded PO
   */
  public PO getPO(
      final Properties ctx,
      final String tableName,
      final int Record_ID,
      final boolean checkCache,
      final String trxName) {
    final IModelCacheService modelCacheService = Services.get(IModelCacheService.class);
    if (checkCache) {
      final PO poCached = modelCacheService.retrieveObject(ctx, tableName, Record_ID, trxName);
      if (poCached != null) {
        return poCached;
      }
    }

    final PO po = retrievePO(ctx, tableName, Record_ID, trxName);
    modelCacheService.addToCache(po);

    return po;
  }