示例#1
0
 /** where句の準備をします。 */
 protected void prepareWhereClause() {
   for (final PropertyMeta propertyMeta : entityMeta.getIdPropertyMetaList()) {
     whereClause.addAndSql(
         ConditionType.EQ.getCondition(propertyMeta.getColumnMeta().getName(), null));
   }
   if (!includeVersion && entityMeta.hasVersionPropertyMeta()) {
     final PropertyMeta propertyMeta = entityMeta.getVersionPropertyMeta();
     whereClause.addAndSql(
         ConditionType.EQ.getCondition(propertyMeta.getColumnMeta().getName(), null));
   }
 }
示例#2
0
 /**
  * SQLに変換します。
  *
  * @return SQL
  */
 @Override
 protected String toSql() {
   final String tableName = entityMeta.getTableMeta().getFullName();
   final StringBuilder buf =
       new StringBuilder(
           UPDATE_STATEMENT.length()
               + tableName.length()
               + setClause.getLength()
               + whereClause.getLength());
   return new String(
       buf.append(UPDATE_STATEMENT)
           .append(tableName)
           .append(setClause.toSql())
           .append(whereClause.toSql()));
 }