Exemplo n.º 1
0
 static ORMSQLContext getDelete(String clazzName, Object object, List<Object> objects) {
   long hashCode = HashCodeUtil.computeHashOverload(object, clazzName, objects);
   ORMSQLContext context = mpDeleteSQL.get(hashCode);
   if (null == context) {
     synchronized (mpDeleteSQL) {
       if (null == context) {
         context = buildDeleteColumnList(object, ORMResourceRegistry.getClass(clazzName));
         LOGGER.info("Caching Delete SQL:" + context.getSQL());
         mpDeleteSQL.put(hashCode, context);
       }
     }
   }
   return context;
 }
Exemplo n.º 2
0
 static ORMSQLContext getCreate(Object object, List<Object> objects) {
   String clazzName = ORMResourceRegistry.getClassName(object);
   long hashCode = HashCodeUtil.computeHashOverload(object, clazzName, objects);
   ORMSQLContext context = mpCreateSQL.get(hashCode);
   if (null == context) {
     synchronized (mpCreateSQL) {
       if (null == context) {
         context =
             buildCreateColumnList(
                 object, ORMResourceRegistry.getClass(clazzName), "INSERT INTO", "create");
         LOGGER.info("Caching Create SQL(hashcode:" + hashCode + ") " + context.getSQL());
         mpCreateSQL.put(hashCode, context);
       }
     }
   }
   clazzName = null;
   return context;
 }