incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1234456 [5/17] - in /incubator/isis/trunk/framework/runtimes: dflt/bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/classsubstitutor/ dflt/bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/objec...
Date Sun, 22 Jan 2012 07:36:26 GMT
Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java Sun Jan 22 07:36:07 2012
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
@@ -45,10 +43,12 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMapping;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMapping;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistorUtil;
+import org.apache.log4j.Logger;
 
 /**
- * Stores 1-to-many collections by creating a foreign-key column in the table for the incoming objectAssociation class.
- * This assumes this the class is only ever in 1 collection parent.
+ * Stores 1-to-many collections by creating a foreign-key column in the table
+ * for the incoming objectAssociation class. This assumes this the class is only
+ * ever in 1 collection parent.
  * 
  * @version $Rev$ $Date$
  */
@@ -64,8 +64,7 @@ public class ForeignKeyCollectionMapper 
 
     private ObjectMapping originalMapping = null;
 
-    public ForeignKeyCollectionMapper(final ObjectAssociation objectAssociation, final String parameterBase,
-        final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup) {
+    public ForeignKeyCollectionMapper(final ObjectAssociation objectAssociation, final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup) {
         super(objectAssociation.getSpecification().getFullIdentifier(), parameterBase, lookup, objectMapperLookup);
 
         this.field = objectAssociation;
@@ -82,8 +81,7 @@ public class ForeignKeyCollectionMapper 
         foreignKeyMapping = lookup.createMapping(columnName, specification);
     }
 
-    protected ForeignKeyCollectionMapper(final FieldMappingLookup lookup, final AbstractAutoMapper abstractAutoMapper,
-        final ObjectAssociation field) {
+    protected ForeignKeyCollectionMapper(final FieldMappingLookup lookup, final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
         super(lookup, abstractAutoMapper, field.getSpecification().getFullIdentifier());
 
         this.field = field;
@@ -170,17 +168,15 @@ public class ForeignKeyCollectionMapper 
         return idMapping;
     }
 
-    protected void appendCollectionUpdateColumnsToNull(StringBuffer sql) {
+    protected void appendCollectionUpdateColumnsToNull(final StringBuffer sql) {
         sql.append(foreignKeyName + "=NULL ");
     }
 
-    protected void appendCollectionWhereValues(final DatabaseConnector connector, final ObjectAdapter parent,
-        final StringBuffer sql) {
+    protected void appendCollectionWhereValues(final DatabaseConnector connector, final ObjectAdapter parent, final StringBuffer sql) {
         foreignKeyMapping.appendUpdateValues(connector, sql, parent);
     }
 
-    protected void appendCollectionUpdateValues(final DatabaseConnector connector, final ObjectAdapter parent,
-        final StringBuffer sql) {
+    protected void appendCollectionUpdateValues(final DatabaseConnector connector, final ObjectAdapter parent, final StringBuffer sql) {
         appendCollectionWhereValues(connector, parent, sql);
     }
 
@@ -189,8 +185,7 @@ public class ForeignKeyCollectionMapper 
     }
 
     @Override
-    public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parent,
-        final boolean makeResolved) {
+    public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parent, final boolean makeResolved) {
 
         final ObjectAdapter collection = field.get(parent);
         if (collection.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
@@ -199,18 +194,20 @@ public class ForeignKeyCollectionMapper 
 
             final List<ObjectAdapter> list = new ArrayList<ObjectAdapter>();
 
-            loadCollectionIntoList(connector, parent, makeResolved, table, specification, getIdMapping(),
-                fieldMappings, versionMapping, list);
+            loadCollectionIntoList(connector, parent, makeResolved, table, specification, getIdMapping(), fieldMappings, versionMapping, list);
 
             final CollectionFacet collectionFacet = collection.getSpecification().getFacet(CollectionFacet.class);
             collectionFacet.init(collection, list.toArray(new ObjectAdapter[list.size()]));
             PersistorUtil.end(collection);
 
-            // TODO: Need to finalise this behaviour. At the moment, all collections will get infinitely resolved. I
-            // don't think this is desirable. Sub-collections should be left "Partially Resolved".
+            // TODO: Need to finalise this behaviour. At the moment, all
+            // collections will get infinitely resolved. I
+            // don't think this is desirable. Sub-collections should be left
+            // "Partially Resolved".
             if (makeResolved) {
-                for (ObjectAdapter field : list) {
-                    // final ObjectMapping mapping = objectMappingLookup.getMapping(field, connector);
+                for (final ObjectAdapter field : list) {
+                    // final ObjectMapping mapping =
+                    // objectMappingLookup.getMapping(field, connector);
                     if (field.getSpecification().isOfType(parent.getSpecification())) {
                         loadInternalCollection(connector, field, true);
                     }
@@ -219,10 +216,8 @@ public class ForeignKeyCollectionMapper 
         }
     }
 
-    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent,
-        final boolean makeResolved, final String table, ObjectSpecification specification,
-        final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
-        final VersionMapping versionMapping, final List<ObjectAdapter> list) {
+    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent, final boolean makeResolved, final String table, final ObjectSpecification specification, final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
+            final VersionMapping versionMapping, final List<ObjectAdapter> list) {
 
         final StringBuffer sql = new StringBuffer();
         sql.append("select ");
@@ -251,8 +246,7 @@ public class ForeignKeyCollectionMapper 
         rs.close();
     }
 
-    protected void loadFields(final ObjectAdapter object, final Results rs, final boolean makeResolved,
-        final List<FieldMapping> fieldMappings) {
+    protected void loadFields(final ObjectAdapter object, final Results rs, final boolean makeResolved, final List<FieldMapping> fieldMappings) {
         if (object.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
             PersistorUtil.start(object, ResolveState.RESOLVING);
             for (final FieldMapping mapping : fieldMappings) {
@@ -266,8 +260,8 @@ public class ForeignKeyCollectionMapper 
     }
 
     /**
-     * Override this in the Polymorphic case to return just the elements that are appropriate for the subclass currently
-     * being handled.
+     * Override this in the Polymorphic case to return just the elements that
+     * are appropriate for the subclass currently being handled.
      * 
      * @param collection
      * @return those elements that ought to be used.
@@ -285,7 +279,8 @@ public class ForeignKeyCollectionMapper 
 
         final Iterator<ObjectAdapter> elements = getElementsForCollectionAsIterator(collection);
 
-        // TODO What is needed to allow a collection update (add/remove) to mark the collection as dirty?
+        // TODO What is needed to allow a collection update (add/remove) to mark
+        // the collection as dirty?
         // checkIfDirty(collection);
 
         if (elements.hasNext() == false) {
@@ -309,8 +304,7 @@ public class ForeignKeyCollectionMapper 
         connector.update(sql.toString());
     }
 
-    protected void resetCollectionParent(final DatabaseConnector connector, final ObjectAdapter parent,
-        final Iterator<ObjectAdapter> elements) {
+    protected void resetCollectionParent(final DatabaseConnector connector, final ObjectAdapter parent, final Iterator<ObjectAdapter> elements) {
         // Reinstall collection parent
         final StringBuffer update = new StringBuffer();
         update.append("update ");
@@ -324,8 +318,8 @@ public class ForeignKeyCollectionMapper 
         update.append(" IN (");
 
         int count = 0;
-        for (Iterator<ObjectAdapter> iterator = elements; iterator.hasNext();) {
-            ObjectAdapter element = iterator.next();
+        for (final Iterator<ObjectAdapter> iterator = elements; iterator.hasNext();) {
+            final ObjectAdapter element = iterator.next();
 
             if (count++ > 0) {
                 update.append(",");
@@ -340,7 +334,7 @@ public class ForeignKeyCollectionMapper 
 
     protected void checkIfDirty(final ObjectAdapter collection) {
         // Test: is dirty?
-        ObjectSpecification collectionSpecification = collection.getSpecification();
+        final ObjectSpecification collectionSpecification = collection.getSpecification();
         if (collectionSpecification.isDirty(collection)) {
             LOG.debug(collection.getOid() + " is dirty");
         } else {

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyInChildCollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyInChildCollectionMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyInChildCollectionMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyInChildCollectionMapper.java Sun Jan 22 07:36:07 2012
@@ -24,17 +24,17 @@ package org.apache.isis.runtimes.dflt.ob
 
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.core.metamodel.specloader.specimpl.OneToManyAssociationImpl;
 import org.apache.isis.runtimes.dflt.objectstores.sql.FieldMappingLookup;
 import org.apache.isis.runtimes.dflt.objectstores.sql.ObjectMappingLookup;
+import org.apache.log4j.Logger;
 
 /**
- * Used to map 1-to-many collections by creating, in the child table, 1 column per parent collection. The column is
- * named by combining the final part of the parent class name and the collection variable name.
+ * Used to map 1-to-many collections by creating, in the child table, 1 column
+ * per parent collection. The column is named by combining the final part of the
+ * parent class name and the collection variable name.
  * 
  * @author Kevin
  */
@@ -44,9 +44,7 @@ public class ForeignKeyInChildCollection
     protected final ObjectAssociation priorField; // prevents recursion
     protected final List<ObjectAssociation> priorFields;
 
-    public ForeignKeyInChildCollectionMapper(final ObjectAssociation objectAssociation, final String parameterBase,
-        final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup,
-        AbstractAutoMapper abstractAutoMapper, ObjectAssociation field) {
+    public ForeignKeyInChildCollectionMapper(final ObjectAssociation objectAssociation, final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup, final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
         super(objectAssociation, parameterBase, lookup, objectMapperLookup);
 
         priorFields = abstractAutoMapper.fields;
@@ -55,17 +53,16 @@ public class ForeignKeyInChildCollection
         setUpFieldMappers();
     }
 
-    protected ForeignKeyInChildCollectionMapper(final FieldMappingLookup lookup,
-        final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
+    protected ForeignKeyInChildCollectionMapper(final FieldMappingLookup lookup, final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
         super(lookup, abstractAutoMapper, field);
         priorFields = null;
         priorField = null;
     }
 
     @Override
-    protected void getExtraFields(List<ObjectAssociation> existingFields) {
+    protected void getExtraFields(final List<ObjectAssociation> existingFields) {
         if (priorFields != null) {
-            for (ObjectAssociation priorField1 : priorFields) {
+            for (final ObjectAssociation priorField1 : priorFields) {
                 if (existingFields.contains(priorField1) == false) {
                     existingFields.add(priorField1);
                 } else {

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionBaseMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionBaseMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionBaseMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionBaseMapper.java Sun Jan 22 07:36:07 2012
@@ -25,8 +25,6 @@ package org.apache.isis.runtimes.dflt.ob
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -45,13 +43,17 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMapping;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
+import org.apache.log4j.Logger;
 
 /**
- * Used to map 1-to-many collections by creating, in the collection child table (which may be an interface or abstract
- * class), 2 columns per parent collection. The first column is the class type, the second is the entity ID. The columns
- * are named by combining the final part of the parent class name and the collection variable name.
+ * Used to map 1-to-many collections by creating, in the collection child table
+ * (which may be an interface or abstract class), 2 columns per parent
+ * collection. The first column is the class type, the second is the entity ID.
+ * The columns are named by combining the final part of the parent class name
+ * and the collection variable name.
  * 
- * You have a choice between this class and {@link PolymorphicForeignKeyInChildCollectionMapper}
+ * You have a choice between this class and
+ * {@link PolymorphicForeignKeyInChildCollectionMapper}
  * 
  * @author Kevin
  */
@@ -65,9 +67,7 @@ public class PolymorphicForeignKeyInChil
 
     private final OidGenerator oidGenerator;
 
-    public PolymorphicForeignKeyInChildCollectionBaseMapper(final ObjectAssociation objectAssociation,
-        final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup,
-        final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
+    public PolymorphicForeignKeyInChildCollectionBaseMapper(final ObjectAssociation objectAssociation, final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup, final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
 
         super(objectAssociation, parameterBase, lookup, objectMapperLookup, abstractAutoMapper, field);
 
@@ -95,7 +95,7 @@ public class PolymorphicForeignKeyInChil
         }
     }
 
-    protected void addColumn(final DatabaseConnector connection, String columnName, String columnType) {
+    protected void addColumn(final DatabaseConnector connection, final String columnName, final String columnType) {
         final StringBuffer sql = new StringBuffer();
         sql.append("alter table ");
         sql.append(table);
@@ -107,14 +107,13 @@ public class PolymorphicForeignKeyInChil
     }
 
     @Override
-    protected void appendCollectionUpdateColumnsToNull(StringBuffer sql) {
+    protected void appendCollectionUpdateColumnsToNull(final StringBuffer sql) {
         super.appendCollectionUpdateColumnsToNull(sql);
         sql.append(", " + classColumnName + "=NULL ");
     }
 
     @Override
-    protected void appendCollectionUpdateValues(final DatabaseConnector connector, final ObjectAdapter parent,
-        final StringBuffer sql) {
+    protected void appendCollectionUpdateValues(final DatabaseConnector connector, final ObjectAdapter parent, final StringBuffer sql) {
         super.appendCollectionUpdateValues(connector, parent, sql);
     }
 
@@ -135,13 +134,12 @@ public class PolymorphicForeignKeyInChil
     }
 
     @Override
-    protected void resetCollectionParent(final DatabaseConnector connector, final ObjectAdapter parent,
-        final Iterator<ObjectAdapter> elements) {
+    protected void resetCollectionParent(final DatabaseConnector connector, final ObjectAdapter parent, final Iterator<ObjectAdapter> elements) {
         LOG.debug("Saving polymorphic list");
 
         ObjectSpecification elementSpecification;
         while (elements.hasNext()) {
-            ObjectAdapter thisAdapter = elements.next();
+            final ObjectAdapter thisAdapter = elements.next();
             elementSpecification = thisAdapter.getSpecification();
 
             // Reinstall collection parent
@@ -160,7 +158,8 @@ public class PolymorphicForeignKeyInChil
             final Oid transientOid = oidGenerator.createTransientOid(thisAdapter.getObject());
             oidGenerator.convertTransientToPersistentOid(transientOid);
             polyIdMapper.appendObjectId(connector, update, transientOid);
-            // polyIdMapper.appendObjectId(connector, update, thisAdapter.getOid());
+            // polyIdMapper.appendObjectId(connector, update,
+            // thisAdapter.getOid());
             update.append(",");
 
             // Foreign key ID column
@@ -184,10 +183,8 @@ public class PolymorphicForeignKeyInChil
     }
 
     @Override
-    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent,
-        final boolean makeResolved, final String table, ObjectSpecification specification,
-        final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
-        final VersionMapping versionMapping, final List<ObjectAdapter> list) {
+    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent, final boolean makeResolved, final String table, final ObjectSpecification specification, final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
+            final VersionMapping versionMapping, final List<ObjectAdapter> list) {
         LOG.debug("Loading polymorphic list");
 
         final StringBuffer sql = new StringBuffer();
@@ -205,16 +202,15 @@ public class PolymorphicForeignKeyInChil
 
         final Results rs = connector.select(sql.toString());
 
-        SpecificationLoader reflector = IsisContext.getSpecificationLoader();
-        final JdbcPolymorphicObjectReferenceMapping idMapping =
-            (JdbcPolymorphicObjectReferenceMapping) idMappingAbstract;
+        final SpecificationLoader reflector = IsisContext.getSpecificationLoader();
+        final JdbcPolymorphicObjectReferenceMapping idMapping = (JdbcPolymorphicObjectReferenceMapping) idMappingAbstract;
 
         while (rs.next()) {
-            ObjectSpecification itemSpecification = reflector.loadSpecification(rs.getString(classColumnName));
+            final ObjectSpecification itemSpecification = reflector.loadSpecification(rs.getString(classColumnName));
             idMapping.setObjectSpecification(itemSpecification);
 
             // Load new recordSet for the actual class
-            ObjectMapping itemMapper = objectMapperLookup.getMapping(itemSpecification, connector);
+            final ObjectMapping itemMapper = objectMapperLookup.getMapping(itemSpecification, connector);
             final Oid oid = idMapping.recreateOid(rs, itemSpecification);
             final ObjectAdapter loadedObject = itemMapper.getObject(connector, oid, itemSpecification);
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionMapper.java Sun Jan 22 07:36:07 2012
@@ -26,8 +26,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -38,12 +36,15 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.ObjectMappingLookup;
 import org.apache.isis.runtimes.dflt.objectstores.sql.VersionMapping;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMapping;
+import org.apache.log4j.Logger;
 
 /**
- * Used to map 1-to-many collections by creating, in the child table, 1 column per parent collection. The column is
- * named by combining the final part of the parent class name and the collection variable name.
+ * Used to map 1-to-many collections by creating, in the child table, 1 column
+ * per parent collection. The column is named by combining the final part of the
+ * parent class name and the collection variable name.
  * 
- * You have a choice between this class and {@link PolymorphicForeignKeyInChildCollectionBaseMapper}
+ * You have a choice between this class and
+ * {@link PolymorphicForeignKeyInChildCollectionBaseMapper}
  * 
  * @author Kevin
  */
@@ -69,9 +70,7 @@ public class PolymorphicForeignKeyInChil
     final ObjectMappingLookup objectMapperLookup;
     final String fieldClassName;
 
-    public PolymorphicForeignKeyInChildCollectionMapper(final ObjectAssociation objectAssociation,
-        final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup,
-        final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
+    public PolymorphicForeignKeyInChildCollectionMapper(final ObjectAssociation objectAssociation, final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectMapperLookup, final AbstractAutoMapper abstractAutoMapper, final ObjectAssociation field) {
 
         super(lookup, abstractAutoMapper, field);
 
@@ -90,25 +89,25 @@ public class PolymorphicForeignKeyInChil
         addSubSpecificationsToTable(specification);
     }
 
-    protected void addSubSpecificationsToTable(ObjectSpecification objectSpecification) {
+    protected void addSubSpecificationsToTable(final ObjectSpecification objectSpecification) {
         if (objectSpecification.isAbstract() == false) {
             final String tableNameFromSpecification = getTableNameFromSpecification(objectSpecification);
             tables.add(tableNameFromSpecification);
             tableSpecifications.add(objectSpecification);
 
-            ObjectMapping autoMapper = objectMapperLookup.getMapping(objectSpecification, null);
+            final ObjectMapping autoMapper = objectMapperLookup.getMapping(objectSpecification, null);
             subClassMappers.add(autoMapper);
         }
         if (objectSpecification.hasSubclasses()) {
-            for (ObjectSpecification subSpecification : objectSpecification.subclasses()) {
+            for (final ObjectSpecification subSpecification : objectSpecification.subclasses()) {
                 addSubSpecificationsToTable(subSpecification);
             }
         }
     }
 
     @Override
-    public boolean needsTables(DatabaseConnector connection) {
-        for (String subTableName : tables) {
+    public boolean needsTables(final DatabaseConnector connection) {
+        for (final String subTableName : tables) {
             table = subTableName;
             if (super.needsTables(connection)) {
                 // Stop on first table that is needed.
@@ -120,7 +119,7 @@ public class PolymorphicForeignKeyInChil
 
     @Override
     public void createTables(final DatabaseConnector connection) {
-        for (String subTableName : tables) {
+        for (final String subTableName : tables) {
             table = subTableName;
             if (super.needsTables(connection)) {
                 super.createTables(connection);
@@ -141,7 +140,7 @@ public class PolymorphicForeignKeyInChil
         currentCollection = new ArrayList<ObjectAdapter>();
         currentIterator = super.getElementsForCollectionAsIterator(collection);
         for (; currentIterator.hasNext();) {
-            ObjectAdapter item = currentIterator.next();
+            final ObjectAdapter item = currentIterator.next();
             currentCollection.add(item);
         }
 
@@ -154,7 +153,7 @@ public class PolymorphicForeignKeyInChil
                 @Override
                 public boolean hasNext() {
                     for (int i = currentIndexStart; i < currentCollection.size(); i++) {
-                        ObjectAdapter thisObjectAdapter = currentCollection.get(i);
+                        final ObjectAdapter thisObjectAdapter = currentCollection.get(i);
                         if (thisObjectAdapter.getSpecification().isOfType(currentTableSpecification)) {
                             currentIndexStart = currentIndex = i;
                             return true;
@@ -181,19 +180,16 @@ public class PolymorphicForeignKeyInChil
     }
 
     @Override
-    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent,
-        final boolean makeResolved, final String table, final ObjectSpecification specification,
-        final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
-        final VersionMapping versionMapping, final List<ObjectAdapter> superList) {
+    protected void loadCollectionIntoList(final DatabaseConnector connector, final ObjectAdapter parent, final boolean makeResolved, final String table, final ObjectSpecification specification, final IdMappingAbstract idMappingAbstract, final List<FieldMapping> fieldMappings,
+            final VersionMapping versionMapping, final List<ObjectAdapter> superList) {
         final List<ObjectAdapter> list = new ArrayList<ObjectAdapter>();
         for (int i = 0; i < tables.size(); i++) {
 
             currentTableSpecification = tableSpecifications.get(i);
-            AutoMapper mapper = (AutoMapper) subClassMappers.get(i);
-            String mapperTable = tables.get(i);
+            final AutoMapper mapper = (AutoMapper) subClassMappers.get(i);
+            final String mapperTable = tables.get(i);
 
-            super.loadCollectionIntoList(connector, parent, makeResolved, mapperTable, currentTableSpecification,
-                mapper.getIdMapping(), mapper.fieldMappings, mapper.getVersionMapping(), list);
+            super.loadCollectionIntoList(connector, parent, makeResolved, mapperTable, currentTableSpecification, mapper.getIdMapping(), mapper.fieldMappings, mapper.getVersionMapping(), list);
 
             superList.addAll(list);
             list.clear();

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java Sun Jan 22 07:36:07 2012
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
@@ -41,16 +39,19 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMapping;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMapping;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistorUtil;
+import org.apache.log4j.Logger;
 
-/** used where there is a one to many association, and the elements are only known to parent */
+/**
+ * used where there is a one to many association, and the elements are only
+ * known to parent
+ */
 public class ReversedAutoAssociationMapper extends AbstractAutoMapper implements CollectionMapper {
     private static final Logger LOG = Logger.getLogger(ReversedAutoAssociationMapper.class);
     private final ObjectAssociation field;
     private final ObjectReferenceMapping idMapping;
     private final VersionMapping versionMapping;
 
-    public ReversedAutoAssociationMapper(final String elemenType, final ObjectAssociation field,
-        final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectLookup) {
+    public ReversedAutoAssociationMapper(final String elemenType, final ObjectAssociation field, final String parameterBase, final FieldMappingLookup lookup, final ObjectMappingLookup objectLookup) {
         super(elemenType, parameterBase, lookup, objectLookup);
 
         this.field = field;
@@ -86,8 +87,7 @@ public class ReversedAutoAssociationMapp
     }
 
     @Override
-    public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parent,
-        final boolean makeResolved) {
+    public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parent, final boolean makeResolved) {
         final ObjectAdapter collection = field.get(parent);
         if (collection.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
             LOG.debug("loading internal collection " + field);
@@ -124,8 +124,8 @@ public class ReversedAutoAssociationMapp
             mapping.initializeField(object, rs);
         }
         /*
-         * for (int i = 0; i < oneToManyProperties.length; i++) { /* Need to set up collection to be a ghost before we
-         * access as below
+         * for (int i = 0; i < oneToManyProperties.length; i++) { /* Need to set
+         * up collection to be a ghost before we access as below
          */
         // CollectionAdapter collection = (CollectionAdapter)
         /*
@@ -148,8 +148,7 @@ public class ReversedAutoAssociationMapp
         reinsertElements(connector, parent, collection);
     }
 
-    private void reinsertElements(final DatabaseConnector connector, final ObjectAdapter parent,
-        final ObjectAdapter collection) {
+    private void reinsertElements(final DatabaseConnector connector, final ObjectAdapter parent, final ObjectAdapter collection) {
         final StringBuffer sql = new StringBuffer();
         sql.append("insert into " + table + " (");
         idMapping.appendColumnNames(sql);

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcFieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcFieldMapping.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcFieldMapping.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcFieldMapping.java Sun Jan 22 07:36:07 2012
@@ -70,8 +70,7 @@ public abstract class AbstractJdbcFieldM
         appendEqualsClause(connector, sql, object, "=");
     }
 
-    protected void appendEqualsClause(final DatabaseConnector connector, final StringBuffer sql,
-        final ObjectAdapter object, final String condition) {
+    protected void appendEqualsClause(final DatabaseConnector connector, final StringBuffer sql, final ObjectAdapter object, final String condition) {
         sql.append(Sql.sqlFieldName(field.getId()));
         sql.append(condition);
         final ObjectAdapter fieldValue = field.get(object);
@@ -92,8 +91,8 @@ public abstract class AbstractJdbcFieldM
     }
 
     @Override
-    public void appendWhereObject(DatabaseConnector connector, ObjectAdapter objectAdapter) {
-        Object object = preparedStatementObject(objectAdapter);
+    public void appendWhereObject(final DatabaseConnector connector, final ObjectAdapter objectAdapter) {
+        final Object object = preparedStatementObject(objectAdapter);
         connector.addToQueryValues(object);
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcMultiFieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcMultiFieldMapping.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcMultiFieldMapping.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/AbstractJdbcMultiFieldMapping.java Sun Jan 22 07:36:07 2012
@@ -39,11 +39,15 @@ public abstract class AbstractJdbcMultiF
      * @param field
      *            the field object association.
      * @param columnCount
-     *            the number of columns required to store this field. See the abstract methods ,
-     *            {@link AbstractJdbcFieldMapping#preparedStatementObject(int i, ObjectAdapter fieldValue)},
-     *            {@link AbstractJdbcFieldMapping#getObjectFromResults(Results results)},
+     *            the number of columns required to store this field. See the
+     *            abstract methods ,
+     *            {@link AbstractJdbcFieldMapping#preparedStatementObject(int i, ObjectAdapter fieldValue)}
+     *            ,
+     *            {@link AbstractJdbcFieldMapping#getObjectFromResults(Results results)}
+     *            ,
      * @param types
-     *            the list of SQL data types, 1 per columnCount, to represent the value type.
+     *            the list of SQL data types, 1 per columnCount, to represent
+     *            the value type.
      */
     public AbstractJdbcMultiFieldMapping(final ObjectAssociation field, final int columnCount, final String... types) {
         super(field);
@@ -116,8 +120,7 @@ public abstract class AbstractJdbcMultiF
         appendUpdateValues(connector, sql, object);
     }
 
-    private void appendEqualsClause(final DatabaseConnector connector, final int index, final StringBuffer sql,
-        final Object object, final String condition) {
+    private void appendEqualsClause(final DatabaseConnector connector, final int index, final StringBuffer sql, final Object object, final String condition) {
 
         final Object oPart = preparedStatementObject(index, object);
 
@@ -133,8 +136,14 @@ public abstract class AbstractJdbcMultiF
     public ObjectAdapter setFromDBColumn(final Results results, final String columnName, final ObjectAssociation field) {
         ObjectAdapter restoredValue;
         final Object objectValue = getObjectFromResults(results);
-        restoredValue = adapterManager.adapterFor(objectValue); // NOTE: If this fails, then fetch back the declaration
-                                                                // from the constructor to here.
+        restoredValue = adapterManager.adapterFor(objectValue); // NOTE: If this
+                                                                // fails, then
+                                                                // fetch back
+                                                                // the
+                                                                // declaration
+                                                                // from the
+                                                                // constructor
+                                                                // to here.
         return restoredValue;
     }
 
@@ -164,8 +173,8 @@ public abstract class AbstractJdbcMultiF
     }
 
     /**
-     * Return an object suitable for passing to the SQL prepared statement constructor, to handle field "index". Will be
-     * called "columnCount" times.
+     * Return an object suitable for passing to the SQL prepared statement
+     * constructor, to handle field "index". Will be called "columnCount" times.
      * 
      * @param index
      *            0 based index

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcAbstractReferenceFieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcAbstractReferenceFieldMapping.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcAbstractReferenceFieldMapping.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcAbstractReferenceFieldMapping.java Sun Jan 22 07:36:07 2012
@@ -37,8 +37,9 @@ import org.apache.isis.runtimes.dflt.run
 /**
  * Provides support for persisting abstract classes and interfaces.
  * 
- * Provides two columns: the first is the standard property field. The second is initialised only when the field is
- * "saved", and contains the actual classname of the persisted concrete class.
+ * Provides two columns: the first is the standard property field. The second is
+ * initialised only when the field is "saved", and contains the actual classname
+ * of the persisted concrete class.
  * 
  * 
  * @version $Rev$ $Date$
@@ -55,12 +56,12 @@ public class JdbcAbstractReferenceFieldM
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, Defaults.TYPE_LONG_STRING());
+            final String dataType = getTypeOverride(object, field, Defaults.TYPE_LONG_STRING());
             return new JdbcAbstractReferenceFieldMapping(field, dataType);
         }
     }
 
-    public JdbcAbstractReferenceFieldMapping(final ObjectAssociation field, String dataType) {
+    public JdbcAbstractReferenceFieldMapping(final ObjectAssociation field, final String dataType) {
         super(field);
         this.dataType = dataType;
         classnameColumn = Sql.identifier(getColumn() + "_cls");
@@ -101,7 +102,7 @@ public class JdbcAbstractReferenceFieldM
         super.appendInsertValues(connector, sql, object);
         sql.append(",?");
 
-        ObjectAdapter objectAdapter = field.get(object);
+        final ObjectAdapter objectAdapter = field.get(object);
         if (objectAdapter != null) {
             connector.addToQueryValues(objectAdapter.getSpecification().getFullIdentifier());
         } else {
@@ -117,7 +118,7 @@ public class JdbcAbstractReferenceFieldM
         sql.append(classnameColumn);
         sql.append(" = ?");
 
-        ObjectAdapter objectAdapter = field.get(object);
+        final ObjectAdapter objectAdapter = field.get(object);
         if (objectAdapter != null) {
             connector.addToQueryValues(objectAdapter.getSpecification().getFullIdentifier());
         } else {
@@ -127,7 +128,7 @@ public class JdbcAbstractReferenceFieldM
 
     @Override
     public void initializeField(final ObjectAdapter object, final Results rs) {
-        String className = rs.getString(classnameColumn);
+        final String className = rs.getString(classnameColumn);
         if (className != null) {
             final ObjectSpecification specification = getReflector().loadSpecification(className);
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcBinaryValueMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcBinaryValueMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcBinaryValueMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcBinaryValueMapper.java Sun Jan 22 07:36:07 2012
@@ -42,7 +42,7 @@ public class JdbcBinaryValueMapper exten
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, type);
+            final String dataType = getTypeOverride(object, field, type);
             return new JdbcBinaryValueMapper(field, dataType);
         }
     }
@@ -57,7 +57,9 @@ public class JdbcBinaryValueMapper exten
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#columnType()
+     * @see
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #columnType()
      */
     @Override
     protected String columnType() {
@@ -68,7 +70,8 @@ public class JdbcBinaryValueMapper exten
      * (non-Javadoc)
      * 
      * @see
-     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#preparedStatementObject(org.apache
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #preparedStatementObject(org.apache
      * .isis.core.metamodel.adapter.ObjectAdapter)
      */
     @Override
@@ -84,13 +87,13 @@ public class JdbcBinaryValueMapper exten
      * (non-Javadoc)
      * 
      * @see
-     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#setFromDBColumn(org.apache.isis.
-     * runtimes.dflt.objectstores.sql.Results, java.lang.String,
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #setFromDBColumn(org.apache.isis. runtimes.dflt.objectstores.sql.Results,
+     * java.lang.String,
      * org.apache.isis.core.metamodel.spec.feature.ObjectAssociation)
      */
     @Override
-    protected ObjectAdapter setFromDBColumn(final Results results, final String columnName,
-        final ObjectAssociation field) {
+    protected ObjectAdapter setFromDBColumn(final Results results, final String columnName, final ObjectAssociation field) {
         ObjectAdapter restoredValue;
 
         final Class<?> correspondingClass = field.getSpecification().getCorrespondingClass();

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcColorValueMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcColorValueMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcColorValueMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcColorValueMapper.java Sun Jan 22 07:36:07 2012
@@ -42,7 +42,7 @@ public class JdbcColorValueMapper extend
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, type);
+            final String dataType = getTypeOverride(object, field, type);
             return new JdbcColorValueMapper(field, dataType);
         }
     }
@@ -57,7 +57,9 @@ public class JdbcColorValueMapper extend
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#columnType()
+     * @see
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #columnType()
      */
     @Override
     protected String columnType() {
@@ -68,7 +70,8 @@ public class JdbcColorValueMapper extend
      * (non-Javadoc)
      * 
      * @see
-     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#preparedStatementObject(org.apache
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #preparedStatementObject(org.apache
      * .isis.core.metamodel.adapter.ObjectAdapter)
      */
     @Override
@@ -81,13 +84,13 @@ public class JdbcColorValueMapper extend
      * (non-Javadoc)
      * 
      * @see
-     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping#setFromDBColumn(org.apache.isis.
-     * runtimes.dflt.objectstores.sql.Results, java.lang.String,
+     * org.apache.isis.runtimes.dflt.objectstores.sql.jdbc.AbstractJdbcFieldMapping
+     * #setFromDBColumn(org.apache.isis. runtimes.dflt.objectstores.sql.Results,
+     * java.lang.String,
      * org.apache.isis.core.metamodel.spec.feature.ObjectAssociation)
      */
     @Override
-    protected ObjectAdapter setFromDBColumn(final Results results, final String columnName,
-        final ObjectAssociation field) {
+    protected ObjectAdapter setFromDBColumn(final Results results, final String columnName, final ObjectAssociation field) {
         ObjectAdapter restoredValue;
         final int intValue = results.getInt(columnName);
         final Color colorValue = new Color(intValue);

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcConnector.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcConnector.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcConnector.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcConnector.java Sun Jan 22 07:36:07 2012
@@ -29,10 +29,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-import org.joda.time.DateTimeZone;
-import org.joda.time.LocalDate;
-
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.runtimes.dflt.objectstores.sql.AbstractDatabaseConnector;
@@ -41,6 +37,9 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore;
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStoreException;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.log4j.Logger;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
 
 public class JdbcConnector extends AbstractDatabaseConnector {
     private static final Logger LOG = Logger.getLogger(JdbcConnector.class);
@@ -51,7 +50,7 @@ public class JdbcConnector extends Abstr
         baseName = SqlObjectStore.BASE_NAME;
     }
 
-    public JdbcConnector(String propertyBase) {
+    public JdbcConnector(final String propertyBase) {
         baseName = propertyBase;
     }
 
@@ -132,36 +131,47 @@ public class JdbcConnector extends Abstr
     }
 
     /*
-     * public void executeStoredProcedure(final StoredProcedure storedProcedure) { Parameter[] parameters =
-     * storedProcedure.getParameters(); StringBuffer sql = new StringBuffer("{call ");
-     * sql.append(storedProcedure.getName()); sql.append(" ("); for (int i = 0, no = parameters.length; i < no; i++) {
-     * sql.append(i == 0 ? "?" : ",?"); } sql.append(")}"); LOG.debug("SQL: " + sql);
+     * public void executeStoredProcedure(final StoredProcedure storedProcedure)
+     * { Parameter[] parameters = storedProcedure.getParameters(); StringBuffer
+     * sql = new StringBuffer("{call "); sql.append(storedProcedure.getName());
+     * sql.append(" ("); for (int i = 0, no = parameters.length; i < no; i++) {
+     * sql.append(i == 0 ? "?" : ",?"); } sql.append(")}"); LOG.debug("SQL: " +
+     * sql);
      * 
-     * CallableStatement statement; try { statement = connection.prepareCall(sql.toString());
+     * CallableStatement statement; try { statement =
+     * connection.prepareCall(sql.toString());
      * 
-     * for (int i = 0; i < parameters.length; i++) { LOG.debug(" setup param " + i + " " + parameters[i]);
-     * parameters[i].setupParameter(i + 1, parameters[i].getName(), storedProcedure); } LOG.debug(" execute ");
-     * statement.execute(); for (int i = 0; i < parameters.length; i++) { parameters[i].retrieve(i + 1,
-     * parameters[i].getName(), storedProcedure); LOG.debug(" retrieve param " + i + " " + parameters[i]); } } catch
+     * for (int i = 0; i < parameters.length; i++) { LOG.debug(" setup param " +
+     * i + " " + parameters[i]); parameters[i].setupParameter(i + 1,
+     * parameters[i].getName(), storedProcedure); } LOG.debug(" execute ");
+     * statement.execute(); for (int i = 0; i < parameters.length; i++) {
+     * parameters[i].retrieve(i + 1, parameters[i].getName(), storedProcedure);
+     * LOG.debug(" retrieve param " + i + " " + parameters[i]); } } catch
      * (SQLException e) { throw new ObjectAdapterRuntimeException(e); }
      * 
      * }
      * 
      * 
-     * public MultipleResults executeStoredProcedure(final String name, final Parameter[] parameters) { StringBuffer sql
-     * = new StringBuffer("{call "); sql.append(name); sql.append(" ("); for (int i = 0; i < parameters.length; i++) {
-     * sql.append(i == 0 ? "?" : ",?"); } sql.append(")}"); LOG.debug("SQL: " + sql);
+     * public MultipleResults executeStoredProcedure(final String name, final
+     * Parameter[] parameters) { StringBuffer sql = new StringBuffer("{call ");
+     * sql.append(name); sql.append(" ("); for (int i = 0; i <
+     * parameters.length; i++) { sql.append(i == 0 ? "?" : ",?"); }
+     * sql.append(")}"); LOG.debug("SQL: " + sql);
      * 
-     * CallableStatement statement; try { statement = connection.prepareCall(sql.toString());
+     * CallableStatement statement; try { statement =
+     * connection.prepareCall(sql.toString());
      * 
      * StoredProcedure storedProcedure = new JdbcStoredProcedure(statement);
      * 
-     * for (int i = 0; i < parameters.length; i++) { LOG.debug(" setup param " + i + " " + parameters[i]);
-     * parameters[i].setupParameter(i + 1, parameters[i].getName(), storedProcedure); } LOG.debug(" execute ");
-     * statement.execute(); for (int i = 0; i < parameters.length; i++) { parameters[i].retrieve(i + 1,
-     * parameters[i].getName(), storedProcedure); LOG.debug(" retrieve param " + i + " " + parameters[i]); }
+     * for (int i = 0; i < parameters.length; i++) { LOG.debug(" setup param " +
+     * i + " " + parameters[i]); parameters[i].setupParameter(i + 1,
+     * parameters[i].getName(), storedProcedure); } LOG.debug(" execute ");
+     * statement.execute(); for (int i = 0; i < parameters.length; i++) {
+     * parameters[i].retrieve(i + 1, parameters[i].getName(), storedProcedure);
+     * LOG.debug(" retrieve param " + i + " " + parameters[i]); }
      * 
-     * return new JdbcResults(statement); } catch (SQLException e) { throw new ObjectAdapterRuntimeException(e); } }
+     * return new JdbcResults(statement); } catch (SQLException e) { throw new
+     * ObjectAdapterRuntimeException(e); } }
      */
 
     @Override
@@ -210,12 +220,12 @@ public class JdbcConnector extends Abstr
                         try {
                             statement.setObject(i, value, java.sql.Types.DATE);
                         } catch (final SQLException e) {
-                            // TODO This daft catch is required my MySQL, which also requires the TimeZone offset to be
+                            // TODO This daft catch is required my MySQL, which
+                            // also requires the TimeZone offset to be
                             // "undone"
                             final LocalDate localDate = (LocalDate) value;
                             final int millisOffset = -DateTimeZone.getDefault().getOffset(null);
-                            final Date javaDate =
-                                localDate.toDateTimeAtStartOfDay(DateTimeZone.forOffsetMillis(millisOffset)).toDate();
+                            final Date javaDate = localDate.toDateTimeAtStartOfDay(DateTimeZone.forOffsetMillis(millisOffset)).toDate();
 
                             statement.setObject(i, javaDate, java.sql.Types.DATE);
                         }
@@ -225,8 +235,7 @@ public class JdbcConnector extends Abstr
                     i++;
                 }
             } catch (final SQLException e) {
-                LOG.error("Error adding prepared value " + i + " of type "
-                    + queryValues.get(i - 1).getClass().getSimpleName(), e);
+                LOG.error("Error adding prepared value " + i + " of type " + queryValues.get(i - 1).getClass().getSimpleName(), e);
                 throw e;
             }
         }
@@ -279,7 +288,8 @@ public class JdbcConnector extends Abstr
             statement = connection.prepareStatement(sql);
             statement.executeUpdate();
             /*
-             * require 3.0 ResultSet rs = statement.getGeneratedKeys(); if(rs.next()) { int id = rs.getInt(1); }
+             * require 3.0 ResultSet rs = statement.getGeneratedKeys();
+             * if(rs.next()) { int id = rs.getInt(1); }
              */statement.close();
         } catch (final SQLException e) {
             throw new SqlObjectStoreException("SQL error", e);
@@ -340,8 +350,7 @@ public class JdbcConnector extends Abstr
             final DatabaseMetaData metaData = connection.getMetaData();
             debug.appendln("Product", metaData.getDatabaseProductName() + "  " + metaData.getDatabaseProductVersion());
             try {
-                debug.appendln("Product Version",
-                    metaData.getDatabaseMajorVersion() + "." + metaData.getDatabaseMinorVersion());
+                debug.appendln("Product Version", metaData.getDatabaseMajorVersion() + "." + metaData.getDatabaseMinorVersion());
             } catch (final AbstractMethodError ignore) {
             }
             debug.appendln("Drive", metaData.getDriverName() + "  " + metaData.getDriverVersion());

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateMapper.java Sun Jan 22 07:36:07 2012
@@ -19,8 +19,6 @@
 
 package org.apache.isis.runtimes.dflt.objectstores.sql.jdbc;
 
-import org.joda.time.LocalDate;
-
 import org.apache.isis.applib.PersistFailedException;
 import org.apache.isis.applib.value.Date;
 import org.apache.isis.core.commons.exceptions.IsisApplicationException;
@@ -33,9 +31,11 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMapping;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
+import org.joda.time.LocalDate;
 
 /**
- * Handles reading and writing java.sql.Date and org.apache.isis.applib.value.Date values to and from the data store.
+ * Handles reading and writing java.sql.Date and
+ * org.apache.isis.applib.value.Date values to and from the data store.
  * 
  * 
  * @version $Rev$ $Date$
@@ -47,8 +47,8 @@ public class JdbcDateMapper extends Abst
 
     public static class Factory extends AbstractFieldMappingFactory {
         @Override
-        public FieldMapping createFieldMapping(ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, Defaults.TYPE_DATE());
+        public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
+            final String dataType = getTypeOverride(object, field, Defaults.TYPE_DATE());
             return new JdbcDateMapper(field, dataType);
         }
     }
@@ -70,8 +70,7 @@ public class JdbcDateMapper extends Abst
             final Date asDate = (Date) value.getObject();
             return new LocalDate(asDate.getMillisSinceEpoch());
         } else {
-            throw new IsisApplicationException("Unimplemented JdbcDateMapper instance type: "
-                + value.getClass().toString());
+            throw new IsisApplicationException("Unimplemented JdbcDateMapper instance type: " + value.getClass().toString());
         }
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateTimeMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateTimeMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateTimeMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcDateTimeMapper.java Sun Jan 22 07:36:07 2012
@@ -35,8 +35,8 @@ public class JdbcDateTimeMapper extends 
 
     public static class Factory extends AbstractFieldMappingFactory {
         @Override
-        public FieldMapping createFieldMapping(ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, Defaults.TYPE_DATETIME());
+        public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
+            final String dataType = getTypeOverride(object, field, Defaults.TYPE_DATETIME());
             return new JdbcDateTimeMapper(field, dataType);
         }
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcGeneralValueMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcGeneralValueMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcGeneralValueMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcGeneralValueMapper.java Sun Jan 22 07:36:07 2012
@@ -42,7 +42,7 @@ public class JdbcGeneralValueMapper exte
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, type);
+            final String dataType = getTypeOverride(object, field, type);
             return new JdbcGeneralValueMapper(field, dataType);
         }
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcMoneyValueMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcMoneyValueMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcMoneyValueMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcMoneyValueMapper.java Sun Jan 22 07:36:07 2012
@@ -28,7 +28,8 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMappingFactory;
 
 /**
- * Money needs to implement a two-column persistence, 1 for amount, 1 for 3-digit currency
+ * Money needs to implement a two-column persistence, 1 for amount, 1 for
+ * 3-digit currency
  * 
  * @version $Rev$ $Date$
  */
@@ -44,7 +45,7 @@ public class JdbcMoneyValueMapper extend
         }
 
         @Override
-        public FieldMapping createFieldMapping(ObjectSpecification object, final ObjectAssociation field) {
+        public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
             return new JdbcMoneyValueMapper(field, type1, type2);
         }
     }
@@ -63,8 +64,7 @@ public class JdbcMoneyValueMapper extend
                 return ((Money) o).getCurrency();
             }
         } else {
-            throw new PersistFailedException("Invalid object type " + o.getClass().getCanonicalName()
-                + " for MoneyValueMapper");
+            throw new PersistFailedException("Invalid object type " + o.getClass().getCanonicalName() + " for MoneyValueMapper");
         }
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceFieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceFieldMapping.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceFieldMapping.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceFieldMapping.java Sun Jan 22 07:36:07 2012
@@ -35,9 +35,9 @@ public class JdbcObjectReferenceFieldMap
 
     public static class Factory extends AbstractFieldMappingFactory {
         @Override
-        public FieldMapping createFieldMapping(ObjectSpecification object, final ObjectAssociation field) {
+        public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
             if (field.getSpecification().isAbstract()) {
-                String dataType = getTypeOverride(object, field, Defaults.TYPE_LONG_STRING());
+                final String dataType = getTypeOverride(object, field, Defaults.TYPE_LONG_STRING());
                 return new JdbcAbstractReferenceFieldMapping(field, dataType);
             }
             return new JdbcObjectReferenceFieldMapping(field);
@@ -53,7 +53,7 @@ public class JdbcObjectReferenceFieldMap
     }
 
     @Override
-    public void appendWhereObject(DatabaseConnector connector, ObjectAdapter objectAdapter) {
+    public void appendWhereObject(final DatabaseConnector connector, final ObjectAdapter objectAdapter) {
         final ObjectAdapter fieldValue = field.get(objectAdapter);
         connector.addToQueryValues(primaryKeyAsObject(fieldValue.getOid()));
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java Sun Jan 22 07:36:07 2012
@@ -26,8 +26,7 @@ import org.apache.isis.runtimes.dflt.obj
 public class JdbcObjectReferenceMappingFactory implements ObjectReferenceMappingFactory {
 
     @Override
-    public ObjectReferenceMapping createReferenceMapping(final String columnName,
-        final ObjectSpecification specification) {
+    public ObjectReferenceMapping createReferenceMapping(final String columnName, final ObjectSpecification specification) {
         return new JdbcObjectReferenceMapping(columnName, specification);
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcPolymorphicObjectReferenceMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcPolymorphicObjectReferenceMapping.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcPolymorphicObjectReferenceMapping.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcPolymorphicObjectReferenceMapping.java Sun Jan 22 07:36:07 2012
@@ -37,7 +37,7 @@ public class JdbcPolymorphicObjectRefere
         setColumn(idColumn);
     }
 
-    public void setObjectSpecification(ObjectSpecification specification) {
+    public void setObjectSpecification(final ObjectSpecification specification) {
         this.specification = specification;
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java Sun Jan 22 07:36:07 2012
@@ -95,8 +95,10 @@ public class JdbcResults implements Resu
         try {
             // 2010-03-05 = 1267747200000
             // 2010-04-08 = 1270684800000
-            // This is really painful! Java refuses to create java.util.Date in UTC!
-            // It creates java.util.Dates in Local time-zone, but assumes the DB date is UTC.
+            // This is really painful! Java refuses to create java.util.Date in
+            // UTC!
+            // It creates java.util.Dates in Local time-zone, but assumes the DB
+            // date is UTC.
             final String string = set.getString(columnName);
             final DateTime utcDate = new DateTime(string, Defaults.getTimeZone());
             final java.sql.Date date = new java.sql.Date(utcDate.getMillis());
@@ -145,8 +147,10 @@ public class JdbcResults implements Resu
         try {
             // 2010-03-05 = 1267747200000
             // 2010-04-08 = 1270684800000
-            // This is really painful! Java refuses to create java.util.Date in UTC!
-            // It creates java.util.Dates in Local time-zone, but assumes the DB date is UTC.
+            // This is really painful! Java refuses to create java.util.Date in
+            // UTC!
+            // It creates java.util.Dates in Local time-zone, but assumes the DB
+            // date is UTC.
             final String string = set.getString(columnName);
             final DateTime utcDate = new DateTime(string, Defaults.getTimeZone());
             return new Date(utcDate);

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java Sun Jan 22 07:36:07 2012
@@ -38,7 +38,7 @@ public class JdbcTimeMapper extends Abst
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, Defaults.TYPE_TIME());
+            final String dataType = getTypeOverride(object, field, Defaults.TYPE_TIME());
             return new JdbcTimeMapper(field, dataType);
         }
     }
@@ -57,9 +57,12 @@ public class JdbcTimeMapper extends Abst
     @Override
     public ObjectAdapter setFromDBColumn(final Results results, final String columnName, final ObjectAssociation field) {
         /*
-         * Long hour = Long.decode(encodedValue.substring(0, 2)); Long minute = Long.decode(encodedValue.substring(3,
-         * 5)); Long millis = (minute + hour * 60) * 60 * 1000; String valueString = "T" + Long.toString(millis); return
-         * field.getSpecification().getFacet(EncodableFacet.class) .fromEncodedString(valueString);
+         * Long hour = Long.decode(encodedValue.substring(0, 2)); Long minute =
+         * Long.decode(encodedValue.substring(3, 5)); Long millis = (minute +
+         * hour * 60) * 60 * 1000; String valueString = "T" +
+         * Long.toString(millis); return
+         * field.getSpecification().getFacet(EncodableFacet.class)
+         * .fromEncodedString(valueString);
          */
         ObjectAdapter restoredValue;
         final Class<?> correspondingClass = field.getSpecification().getCorrespondingClass();

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java Sun Jan 22 07:36:07 2012
@@ -37,7 +37,7 @@ public class JdbcTimestampMapper extends
 
         @Override
         public FieldMapping createFieldMapping(final ObjectSpecification object, final ObjectAssociation field) {
-            String dataType = getTypeOverride(object, field, Defaults.TYPE_TIMESTAMP());
+            final String dataType = getTypeOverride(object, field, Defaults.TYPE_TIMESTAMP());
             return new JdbcTimestampMapper(field, dataType);
         }
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/DefaultsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/DefaultsTest.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/DefaultsTest.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/DefaultsTest.java Sun Jan 22 07:36:07 2012
@@ -21,17 +21,16 @@ package org.apache.isis.runtimes.dflt.ob
 
 import static org.hamcrest.Matchers.is;
 
-import org.junit.Assert;
-import org.junit.Test;
-
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.junit.Assert;
+import org.junit.Test;
 
 public class DefaultsTest {
     @Test
     public void tablePrefixDefaultsTo_Isis() {
         final String prefix = "isis.persistor.sql";
-        IsisConfiguration config = new IsisConfigurationDefault();
+        final IsisConfiguration config = new IsisConfigurationDefault();
         Defaults.initialise(prefix, config);
         Assert.assertThat(Defaults.getTablePrefix(), is("isis_"));
     }
@@ -40,7 +39,7 @@ public class DefaultsTest {
     public void tablePrefixCanBeReplaced() {
         final String prefix = "isis.persistor.sql";
         final String key = "isis.persistor.sql.default.tableprefix";
-        IsisConfigurationDefault config = new IsisConfigurationDefault();
+        final IsisConfigurationDefault config = new IsisConfigurationDefault();
         config.add(key, "");
         Defaults.initialise(prefix, config);
         Assert.assertThat(Defaults.getTablePrefix(), is(""));

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java Sun Jan 22 07:36:07 2012
@@ -26,7 +26,8 @@ import org.apache.isis.runtimes.dflt.obj
 public class SqlOidTest extends TestCase {
 
     /*
-     * Test method for 'org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.hashCode()'
+     * Test method for
+     * 'org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.hashCode()'
      */
     public void testHashCode() {
         final SqlOid oid1 = new SqlOid("className", new IntegerPrimaryKey(13), State.TRANSIENT);
@@ -36,7 +37,8 @@ public class SqlOidTest extends TestCase
     }
 
     /*
-     * Test method for 'org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.copyFrom(Oid)'
+     * Test method for
+     * 'org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.copyFrom(Oid)'
      */
     public void testCopyFrom() {
 



Mime
View raw message