Author: tv
Date: Fri Apr  6 08:52:00 2018
New Revision: 1828503

URL: http://svn.apache.org/viewvc?rev=1828503&view=rev
Log:
Get rid of synchronization in getDatabaseMap()
Fix bad column names for IDBroker

Modified:
    
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java

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=1828503&r1=1828502&r2=1828503&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
 Fri Apr  6 08:52:00 2018
@@ -86,6 +86,7 @@ public class Database
             throw new NullPointerException("name is null");
         }
         this.name = name;
+        this.databaseMap = new DatabaseMap(this);
     }
 
     /**
@@ -121,14 +122,9 @@ public class Database
 
     /**
      * Returns the database map for this database.
-     * If the database map does not exist yet, it is created by this method.
      */
-    public synchronized DatabaseMap getDatabaseMap()
+    public DatabaseMap getDatabaseMap()
     {
-        if (databaseMap == null)
-        {
-            databaseMap = new DatabaseMap(this);
-        }
         return databaseMap;
     }
 
@@ -218,19 +214,19 @@ public class Database
         {
             return false;
         }
-        setIdTable("ID_TABLE");
+        setIdTable(IDBroker.ID_TABLE);
         TableMap tMap = getIdTable();
-        ColumnMap idTableId = new ColumnMap("QUANTITY", tMap);
+        ColumnMap idTableId = new ColumnMap(IDBroker.COL_TABLE_ID, tMap);
         idTableId.setType(Integer.valueOf(0));
         idTableId.setPrimaryKey(true);
         tMap.addColumn(idTableId);
-        ColumnMap tableName = new ColumnMap("TABLE_NAME", tMap);
+        ColumnMap tableName = new ColumnMap(IDBroker.COL_TABLE_NAME, tMap);
         tableName.setType("");
         tMap.addColumn(tableName);
-        ColumnMap nextId = new ColumnMap("NEXT_ID", tMap);
+        ColumnMap nextId = new ColumnMap(IDBroker.COL_NEXT_ID, tMap);
         nextId.setType(Integer.valueOf(0));
         tMap.addColumn(nextId);
-        ColumnMap quantity = new ColumnMap("QUANTITY", tMap);
+        ColumnMap quantity = new ColumnMap(IDBroker.COL_QUANTITY, tMap);
         quantity.setType(Integer.valueOf(0));
         tMap.addColumn(quantity);
         idBroker = new IDBroker(this);



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org

Reply via email to