Author: tfischer Date: Thu May 10 08:56:52 2012 New Revision: 1336543 URL: http://svn.apache.org/viewvc?rev=1336543&view=rev Log: - TORQUE-201: Change the interface IDMethod to an enum - use final modifier for unchanged fields - us @Deprecated annotation for deprecated methods
Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/imports.vm db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/tableConstantInit.vm Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java Thu May 10 08:56:52 2012 @@ -37,14 +37,11 @@ import org.apache.torque.oid.IdGenerator */ public class Database { - /** The initial size of the Id-Generators map. */ - private static final int ID_GENERATORS_INITIAL_SIZE = 6; - /** * The name of the database. Must be the same as the key in Torque's * databaseMap. */ - private String name; + private final String name; /** * The Database adapter which encapsulates database-specific peculiarities. @@ -73,8 +70,8 @@ public class Database private IDBroker idBroker = null; /** The IdGenerators, keyed by type of idMethod. */ - private Map<String, IdGenerator> idGenerators - = new HashMap<String, IdGenerator>(ID_GENERATORS_INITIAL_SIZE); + private final Map<IDMethod, IdGenerator> idGenerators + = new HashMap<IDMethod, IdGenerator>(); /** * Creates a new Database with the given name. @@ -242,7 +239,7 @@ public class Database * @return The IdGenerator of the requested type, or null if no IdGenerator * exists for the requested type. */ - public IdGenerator getIdGenerator(String type) + public IdGenerator getIdGenerator(IDMethod type) { return idGenerators.get(type); } @@ -251,11 +248,10 @@ public class Database * Adds an IdGenerator to the database. * * @param type The type of the IdGenerator. - * * @param idGen The new IdGenerator for the type, or null * to remove the IdGenerator of the given type. */ - public void addIdGenerator(String type, IdGenerator idGen) + public void addIdGenerator(IDMethod type, IdGenerator idGen) { idGenerators.put(type, idGen); } Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java Thu May 10 08:56:52 2012 @@ -117,7 +117,7 @@ public abstract class AbstractDBAdapter * * @return IDMethod constant */ - public abstract String getIDMethodType(); + public abstract IDMethod getIDMethodType(); /** * Returns SQL used to get the most recently inserted primary key. Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java Thu May 10 08:56:52 2012 @@ -54,7 +54,7 @@ import org.apache.torque.util.functions. * @author <a href="mailto:greg.mon...@dukece.com">Greg Monroe</a> * @version $Id$ */ -public interface DB extends Serializable, IDMethod +public interface DB extends Serializable { /** Key for the configuration which contains database adapters. */ String ADAPTER_KEY = "adapter"; @@ -93,7 +93,7 @@ public interface DB extends Serializable * * @return IDMethod constant */ - String getIDMethodType(); + IDMethod getIDMethodType(); /** * Returns SQL used to get the most recently inserted primary key. Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java Thu May 10 08:56:52 2012 @@ -75,9 +75,9 @@ public class DBDerby extends AbstractDBA * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return AUTO_INCREMENT; + return IDMethod.AUTO_INCREMENT; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java Thu May 10 08:56:52 2012 @@ -73,9 +73,9 @@ public class DBHsqldb extends AbstractDB * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return AUTO_INCREMENT; + return IDMethod.AUTO_INCREMENT; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java Thu May 10 08:56:52 2012 @@ -82,9 +82,9 @@ public class DBMM extends AbstractDBAdap * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return AUTO_INCREMENT; + return IDMethod.AUTO_INCREMENT; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java Thu May 10 08:56:52 2012 @@ -80,9 +80,9 @@ public class DBMSSQL extends AbstractDBA * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return AUTO_INCREMENT; + return IDMethod.AUTO_INCREMENT; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java Thu May 10 08:56:52 2012 @@ -72,9 +72,9 @@ public class DBNone extends AbstractDBAd * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return NO_ID_METHOD; + return IDMethod.NO_ID_METHOD; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java Thu May 10 08:56:52 2012 @@ -85,9 +85,9 @@ public class DBOracle extends AbstractDB * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return SEQUENCE; + return IDMethod.SEQUENCE; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java Thu May 10 08:56:52 2012 @@ -77,9 +77,9 @@ public class DBPostgres extends Abstract * @see org.apache.torque.adapter.DB#getIDMethodType() */ @Override - public String getIDMethodType() + public IDMethod getIDMethodType() { - return SEQUENCE; + return IDMethod.SEQUENCE; } /** Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java Thu May 10 08:56:52 2012 @@ -26,32 +26,71 @@ package org.apache.torque.adapter; * @author <a href="mailto:d...@collab.net">Daniel Rall</a> * @version $Id$ */ -public interface IDMethod +public enum IDMethod { /** * Key generation via database-specific ID method * (i.e. auto-increment for MySQL, sequence for Oracle, etc.). */ - String NATIVE = "native"; + NATIVE("native"), /** * Key generation via auto-increment. */ - String AUTO_INCREMENT = "autoincrement"; + AUTO_INCREMENT("autoincrement"), /** * Key generation via sequences. */ - String SEQUENCE = "sequence"; + SEQUENCE("sequence"), /** * Key generation via the IDBroker table. */ - String ID_BROKER = "idbroker"; + ID_BROKER("idbroker"), /** - * No RDBMS key generation (keys may be generated by the - * application). + * No RDBMS key generation (keys may be generated by the application). */ - String NO_ID_METHOD = "none"; + NO_ID_METHOD("none"); + + /** The name of the id method. */ + private String idMethod; + + /** + * Constructor. + * + * @param idMethod the text of the idMethod. + */ + private IDMethod(String idMethod) + { + this.idMethod = idMethod; + } + + @Override + public String toString() + { + return idMethod; + } + + /** + * Returns the id method for a id method name. + * + * @param idMethod the name of the id method. + * + * @return the id method. + * + * @throws IllegalArgumentException if idMethod is not a known name. + */ + public static IDMethod getIdMethod(String idMethod) + { + for (IDMethod candidate : values()) + { + if (candidate.toString().equals(idMethod)) + { + return candidate; + } + } + throw new IllegalArgumentException("Unknown idMethod " + idMethod); + } } Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java Thu May 10 08:56:52 2012 @@ -42,24 +42,18 @@ import org.apache.torque.adapter.IDMetho * @author <a href="mailto:greg.mon...@dukece.com">Greg Monroe</a> * @version $Id$ */ -public class TableMap implements IDMethod, java.io.Serializable +public class TableMap implements java.io.Serializable { /** The serialVersionUID for this class. */ private static final long serialVersionUID = -9053174532511492818L; - /** The list of valid ID generation methods. */ - protected static final String[] VALID_ID_METHODS = - { - NATIVE, AUTO_INCREMENT, SEQUENCE, ID_BROKER, NO_ID_METHOD - }; - /** The columns in the table. XML Order is preserved. */ - private Map<String, ColumnMap> columns + private final Map<String, ColumnMap> columns = Collections.synchronizedMap( new LinkedHashMap<String, ColumnMap>()); /** The foreign keys in the table. XML Order is preserved. */ - private List<ForeignKeyMap> foreignKeys = new ArrayList<ForeignKeyMap>(); + private final List<ForeignKeyMap> foreignKeys = new ArrayList<ForeignKeyMap>(); /** The database this table belongs to. */ private DatabaseMap dbMap; @@ -80,7 +74,7 @@ public class TableMap implements IDMetho private String prefix; /** The primary key generation method. */ - private String primaryKeyMethod = NO_ID_METHOD; + private IDMethod primaryKeyMethod = IDMethod.NO_ID_METHOD; /** The table description info. */ private String description = ""; @@ -108,10 +102,11 @@ public class TableMap implements IDMetho * The information is keyed by the idMethodType because it might be * different for different id methods. */ - private Map<String, Object> pkInfoMap = new HashMap<String, Object>(); + private final Map<IDMethod, Object> pkInfoMap + = new HashMap<IDMethod, Object>(); /** Associated options. */ - private Map<String, String> optionsMap + private final Map<String, String> optionsMap = Collections.synchronizedMap(new LinkedHashMap<String, String>()); /** @@ -299,7 +294,7 @@ public class TableMap implements IDMetho * * @return A String with the method. */ - public String getPrimaryKeyMethod() + public IDMethod getPrimaryKeyMethod() { return primaryKeyMethod; } @@ -309,7 +304,7 @@ public class TableMap implements IDMetho * * @return An Object. */ - public Object getPrimaryKeyMethodInfo(String idMethod) + public Object getPrimaryKeyMethodInfo(IDMethod idMethod) { if (pkInfoOverride != null) { @@ -392,22 +387,16 @@ public class TableMap implements IDMetho * values are as specified in the {@link * org.apache.torque.adapter.IDMethod} interface. * - * @param method The ID generation method type name. + * @param method The ID generation method type, not null. */ - public void setPrimaryKeyMethod(String method) + public void setPrimaryKeyMethod(IDMethod method) { - primaryKeyMethod = NO_ID_METHOD; - - // Validate ID generation method. - for (int i = 0; i < VALID_ID_METHODS.length; i++) + if (method == null) { - if (VALID_ID_METHODS[i].equalsIgnoreCase(method)) - { - primaryKeyMethod = method; - break; - } + throw new NullPointerException("method must not be null"); } - if (ID_BROKER.equalsIgnoreCase(method)) + primaryKeyMethod = method; + if (IDMethod.ID_BROKER == method) { getDatabaseMap().getDatabase().startIdBroker(); } @@ -431,7 +420,7 @@ public class TableMap implements IDMetho * @param idMethod the id method for which this information is stored. * @param pkInfo information needed to generate a key. */ - public void setPrimaryKeyMethodInfo(String idMethod, Object pkInfo) + public void setPrimaryKeyMethodInfo(IDMethod idMethod, Object pkInfo) { pkInfoMap.put(idMethod, pkInfo); } Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java Thu May 10 08:56:52 2012 @@ -45,7 +45,7 @@ public final class IDGeneratorFactory * The list of ID generation method types which have associated * {@link org.apache.torque.oid.IdGenerator} implementations. */ - public static final String[] ID_GENERATOR_METHODS = + public static final IDMethod[] ID_GENERATOR_METHODS = { IDMethod.NATIVE, IDMethod.AUTO_INCREMENT, IDMethod.SEQUENCE }; @@ -58,16 +58,17 @@ public final class IDGeneratorFactory * Returns <code>null</code> for unknown types. * * @param dbAdapter The type of adapter to create an ID generator for. + * * @return The appropriate ID generator (possibly <code>null</code>). */ public static IdGenerator create(DB dbAdapter, String name) { - String idMethod = dbAdapter.getIDMethodType(); - if (IDMethod.AUTO_INCREMENT.equals(idMethod)) + IDMethod idMethod = dbAdapter.getIDMethodType(); + if (IDMethod.AUTO_INCREMENT == idMethod) { return new AutoIncrementIdGenerator(dbAdapter, name); } - else if (IDMethod.SEQUENCE.equals(idMethod)) + else if (IDMethod.SEQUENCE == idMethod) { return new SequenceIdGenerator(dbAdapter, name); } Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java Thu May 10 08:56:52 2012 @@ -105,6 +105,7 @@ public class BasePeerImpl implements Ser * @deprecated This method is not used any more and will be removed in a * future version of Torque. */ + @Deprecated public String[] initCriteriaKeys( String tableName, String[] columnNames) @@ -136,6 +137,7 @@ public class BasePeerImpl implements Ser * for automatic escaping and more flexibility. * This method will be removed in a future version of Torque. */ + @Deprecated public int deleteAll( Connection con, String table, @@ -197,6 +199,7 @@ public class BasePeerImpl implements Ser * for automatic escaping and more flexibility. * This method will be removed in a future version of Torque. */ + @Deprecated public int deleteAll(String table, String column, int value) throws TorqueException { @@ -228,6 +231,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, TableMap). * This method will be removed in a future version of Torque. */ + @Deprecated protected int doDelete(Criteria criteria) throws TorqueException { return doDelete(criteria, (TableMap) null); @@ -248,6 +252,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, TableMap). * This method will be removed in a future version of Torque. */ + @Deprecated protected int doDelete(org.apache.torque.criteria.Criteria criteria) throws TorqueException { @@ -270,6 +275,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, TableMap, Connection). * This method will be removed in a future version of Torque. */ + @Deprecated protected int doDelete(Criteria criteria, Connection con) throws TorqueException { @@ -305,6 +311,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, TableMap, Connection). * This method will be removed in a future version of Torque. */ + @Deprecated protected int doDelete( org.apache.torque.criteria.Criteria criteria, Connection con) @@ -344,6 +351,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, String). * This method will be removed in a future version of Torque. */ + @Deprecated public int doDelete(Criteria criteria, TableMap tableMap) throws TorqueException { @@ -422,6 +430,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, String, Connection). * This method will be removed in a future version of Torque. */ + @Deprecated public int doDelete( Criteria criteria, TableMap tableMap, @@ -834,8 +843,8 @@ public class BasePeerImpl implements Ser private Object getIdMethodInfo(TableMap tableMap) throws TorqueException { - String idMethod = tableMap.getPrimaryKeyMethod(); - if (IDMethod.NATIVE.equals(idMethod)) + IDMethod idMethod = tableMap.getPrimaryKeyMethod(); + if (IDMethod.NATIVE == idMethod) { String databaseName = tableMap.getDatabaseMap().getDatabase().getName(); @@ -912,6 +921,7 @@ public class BasePeerImpl implements Ser * RecordMapper, TableMap). * This method will be removed in a future version of Torque. */ + @Deprecated public <T> List<T> doSelect( Criteria criteria, RecordMapper<T> mapper, @@ -1135,6 +1145,7 @@ public class BasePeerImpl implements Ser * RecordMapper, TableMap). * This method will be removed in a future version of Torque. */ + @Deprecated public <T> List<T> doSelect( Criteria criteria, RecordMapper<T> mapper, @@ -1545,6 +1556,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, ColumnValues). * This method will be removed in a future version of Torque. */ + @Deprecated public int doUpdate( Criteria selectCriteria, ColumnValues updateValues) @@ -1632,6 +1644,7 @@ public class BasePeerImpl implements Ser * ColumnValues, Connection). * This method will be removed in a future version of Torque. */ + @Deprecated public int doUpdate( Criteria criteria, ColumnValues updateValues, @@ -1994,6 +2007,7 @@ public class BasePeerImpl implements Ser * org.apache.torque.criteria.Criteria, TableMap). * This method will be removed in a future version of Torque. */ + @Deprecated public void correctBooleans( Criteria criteria, TableMap defaultTableMap) @@ -2023,6 +2037,7 @@ public class BasePeerImpl implements Ser * * @deprecated */ + @Deprecated private void correctBooleans( Criteria criteria, Criteria.Criterion criterion, @@ -2144,6 +2159,7 @@ public class BasePeerImpl implements Ser * * @deprecated */ + @Deprecated private void replaceBooleanValues( Criteria.Criterion criterion, Object trueValue, Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/imports.vm URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/imports.vm?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/imports.vm (original) +++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/imports.vm Thu May 10 08:56:52 2012 @@ -27,10 +27,6 @@ ## The options and the attributes of the current source element must be set ## as velocity variables. ## -import static org.apache.torque.adapter.DB.AUTO_INCREMENT; -import static org.apache.torque.adapter.DB.ID_BROKER; -import static org.apache.torque.adapter.DB.SEQUENCE; - import java.util.Date; import java.util.List; import java.util.ArrayList; @@ -39,6 +35,7 @@ import org.apache.torque.Torque; #if ($table.IdMethod == "native") import org.apache.torque.adapter.DB; #end +import org.apache.torque.adapter.IDMethod; import org.apache.torque.map.DatabaseMap; import org.apache.torque.map.TableMap; import org.apache.torque.map.ColumnMap; Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/tableConstantInit.vm URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/tableConstantInit.vm?rev=1336543&r1=1336542&r2=1336543&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/tableConstantInit.vm (original) +++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/mapBuilder/tableConstantInit.vm Thu May 10 08:56:52 2012 @@ -34,11 +34,13 @@ TABLE.setDescription("$description"); #end #if ($idMethod == "native") - TABLE.setPrimaryKeyMethod(TableMap.NATIVE); + TABLE.setPrimaryKeyMethod(IDMethod.NATIVE); #elseif ($idMethod == "idbroker") - TABLE.setPrimaryKeyMethod(TableMap.ID_BROKER); + TABLE.setPrimaryKeyMethod(IDMethod.ID_BROKER); +#elseif ($idMethod == "none") + TABLE.setPrimaryKeyMethod(IDMethod.NO_ID_METHOD); #else - TABLE.setPrimaryKeyMethod("$idMethod"); + TABLE.setPrimaryKeyMethod(IDMethod.getIdMethod("$idMethod")); #end #set ( $idMethodParameterElements = $torqueGen.getChildren("id-method-parameter")) #if (!$idMethodParameterElements.isEmpty()) @@ -47,9 +49,9 @@ #set ( $value = $idMethodParameterElement.getAttribute("value") ) TABLE.setPrimaryKeyMethodInfo("$value"); #else - TABLE.setPrimaryKeyMethodInfo(ID_BROKER, TABLE.getName()); - TABLE.setPrimaryKeyMethodInfo(SEQUENCE, "$sequenceName"); - TABLE.setPrimaryKeyMethodInfo(AUTO_INCREMENT, "$name"); + TABLE.setPrimaryKeyMethodInfo(IDMethod.ID_BROKER, TABLE.getName()); + TABLE.setPrimaryKeyMethodInfo(IDMethod.SEQUENCE, "$sequenceName"); + TABLE.setPrimaryKeyMethodInfo(IDMethod.AUTO_INCREMENT, "$name"); #end #set ( $primaryKeyColumnElements = $torqueGen.getChild("primary-keys").getChildren("column") ) #if ($useManagers == "true" && $primaryKeyColumnElements.size() > 0) --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org