incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098941 [7/8] - in /incubator/isis/trunk/runtimes/dflt/objectstores: nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/ nosql/src/main/java/org/a...
Date Tue, 03 May 2011 06:52:55 GMT
Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMapping.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMapping.java Tue May  3 06:52:51 2011
@@ -19,52 +19,48 @@
 
 package org.apache.isis.runtimes.dflt.objectstores.sql.jdbc;
 
+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;
 import org.apache.isis.runtimes.dflt.objectstores.sql.DatabaseConnector;
 import org.apache.isis.runtimes.dflt.objectstores.sql.IdMappingAbstract;
 import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 import org.apache.isis.runtimes.dflt.objectstores.sql.Sql;
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStoreException;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMapping;
-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;
 
-public class JdbcObjectReferenceMapping extends IdMappingAbstract implements
-		ObjectReferenceMapping {
-	private final ObjectSpecification specification;
-
-	public JdbcObjectReferenceMapping(String columnName,
-			ObjectSpecification specification) {
-		this.specification = specification;
-		String idColumn = Sql.sqlName("fk_" + columnName);
-		setColumn(idColumn);
-	}
-
-	@Override
-	public void appendUpdateValues(DatabaseConnector connector,
-			StringBuffer sql, ObjectAdapter object) {
-		sql.append(getColumn());
-		if (object == null) {
-			sql.append("= NULL ");
-		} else {
-			sql.append("= ?");
-			// sql.append(primaryKey(object.getOid()));
-			connector.addToQueryValues(primaryKeyAsObject(object.getOid()));
-		}
-	}
-
-	public ObjectAdapter initializeField(Results rs) {
-		Oid oid = recreateOid(rs, specification);
-		if (oid != null) {
-			if (specification.isAbstract()) {
-				throw new SqlObjectStoreException(
-						"NOT DEALING WITH POLYMORPHIC ASSOCIATIONS");
-			} else {
-				return getAdapter(specification, oid);
-			}
-		} else {
-			return null;
-		}
-	}
+public class JdbcObjectReferenceMapping extends IdMappingAbstract implements ObjectReferenceMapping {
+    private final ObjectSpecification specification;
+
+    public JdbcObjectReferenceMapping(final String columnName, final ObjectSpecification specification) {
+        this.specification = specification;
+        final String idColumn = Sql.sqlName("fk_" + columnName);
+        setColumn(idColumn);
+    }
+
+    @Override
+    public void appendUpdateValues(final DatabaseConnector connector, final StringBuffer sql, final ObjectAdapter object) {
+        sql.append(getColumn());
+        if (object == null) {
+            sql.append("= NULL ");
+        } else {
+            sql.append("= ?");
+            // sql.append(primaryKey(object.getOid()));
+            connector.addToQueryValues(primaryKeyAsObject(object.getOid()));
+        }
+    }
+
+    public ObjectAdapter initializeField(final Results rs) {
+        final Oid oid = recreateOid(rs, specification);
+        if (oid != null) {
+            if (specification.isAbstract()) {
+                throw new SqlObjectStoreException("NOT DEALING WITH POLYMORPHIC ASSOCIATIONS");
+            } else {
+                return getAdapter(specification, oid);
+            }
+        } else {
+            return null;
+        }
+    }
 
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcObjectReferenceMappingFactory.java Tue May  3 06:52:51 2011
@@ -17,19 +17,18 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.jdbc;
 
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMapping;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMappingFactory;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
 public class JdbcObjectReferenceMappingFactory implements ObjectReferenceMappingFactory {
 
-    public ObjectReferenceMapping createReferenceMapping(String columnName, ObjectSpecification specification) {
+    @Override
+    public ObjectReferenceMapping createReferenceMapping(final String columnName,
+        final ObjectSpecification specification) {
         return new JdbcObjectReferenceMapping(columnName, specification);
     }
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcResults.java Tue May  3 06:52:51 2011
@@ -25,16 +25,15 @@ import java.sql.SQLException;
 import java.util.Calendar;
 import java.util.HashMap;
 
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
-import org.joda.time.format.DateTimeFormat;
-import org.joda.time.format.DateTimeFormatter;
-
 import org.apache.isis.applib.value.Date;
 import org.apache.isis.applib.value.Time;
 import org.apache.isis.runtimes.dflt.objectstores.sql.Defaults;
 import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStoreException;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
 
 public class JdbcResults implements Results {
     ResultSet set;
@@ -50,7 +49,7 @@ public class JdbcResults implements Resu
     public void close() {
         try {
             set.close();
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -59,7 +58,7 @@ public class JdbcResults implements Resu
     public int getInt(final String columnName) {
         try {
             return set.getInt(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -68,7 +67,7 @@ public class JdbcResults implements Resu
     public long getLong(final String columnName) {
         try {
             return set.getLong(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -77,7 +76,7 @@ public class JdbcResults implements Resu
     public String getString(final String columnName) {
         try {
             return set.getString(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -86,7 +85,7 @@ public class JdbcResults implements Resu
     public boolean next() {
         try {
             return set.next();
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -98,11 +97,11 @@ public class JdbcResults implements Resu
             // 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.
-            String string = set.getString(columnName);
+            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());
             return date;
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -110,24 +109,24 @@ public class JdbcResults implements Resu
     @Override
     public java.sql.Time getJavaTimeOnly(final String columnName) {
         try {
-            String string = set.getString(columnName);
+            final String string = set.getString(columnName);
 
-            DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
+            final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
 
             final DateTime utcDate = formatter.withZone(Defaults.getTimeZone()).parseDateTime(string);
             final java.sql.Time time = new java.sql.Time(utcDate.getMillis());
 
             return time;
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public java.util.Date getJavaDateTime(String columnName, Calendar calendar) {
+    public java.util.Date getJavaDateTime(final String columnName, final Calendar calendar) {
         try {
             return set.getDate(columnName, calendar);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
@@ -136,82 +135,82 @@ public class JdbcResults implements Resu
     public Object getObject(final String columnName) {
         try {
             return set.getObject(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Date getDate(String columnName) {
+    public Date getDate(final String columnName) {
         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.
-            String string = set.getString(columnName);
+            final String string = set.getString(columnName);
             final DateTime utcDate = new DateTime(string, Defaults.getTimeZone());
             return new Date(utcDate);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Time getTime(String columnName) {
+    public Time getTime(final String columnName) {
         try {
-            String string = set.getString(columnName);
-            DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
+            final String string = set.getString(columnName);
+            final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
             final DateTimeZone defaultTimeZone = Defaults.getTimeZone();
             final DateTime utcDate = formatter.withZone(defaultTimeZone).parseDateTime(string);
             return new Time(utcDate);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public double getDouble(String columnName) {
+    public double getDouble(final String columnName) {
         try {
             return set.getDouble(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Object getAsType(String columnName, Class<?> clazz) {
+    public Object getAsType(final String columnName, final Class<?> clazz) {
         try {
-            HashMap<String, Class<?>> map = new HashMap<String, Class<?>>();
+            final HashMap<String, Class<?>> map = new HashMap<String, Class<?>>();
             map.put("FLOAT", float.class);
             return set.getObject(columnName, map);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Float getFloat(String columnName) {
+    public Float getFloat(final String columnName) {
         try {
             return set.getFloat(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Short getShort(String columnName) {
+    public Short getShort(final String columnName) {
         try {
             return set.getShort(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }
 
     @Override
-    public Boolean getBoolean(String columnName) {
+    public Boolean getBoolean(final String columnName) {
         try {
             return set.getBoolean(columnName);
-        } catch (SQLException e) {
+        } catch (final SQLException e) {
             throw new SqlObjectStoreException(e);
         }
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcSqlMetaData.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcSqlMetaData.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcSqlMetaData.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcSqlMetaData.java Tue May  3 06:52:51 2011
@@ -34,7 +34,7 @@ public class JdbcSqlMetaData implements 
     private final boolean storesMixedCaseIdentifiers;
     private final boolean storesUpperCaseIdentifiers;
 
-    public JdbcSqlMetaData(DatabaseMetaData metaData) throws SQLException {
+    public JdbcSqlMetaData(final DatabaseMetaData metaData) throws SQLException {
         keywords = metaData.getSQLKeywords();
         timeDateFunctions = metaData.getTimeDateFunctions();
         quoteString = metaData.getIdentifierQuoteString();
@@ -76,7 +76,7 @@ public class JdbcSqlMetaData implements 
     }
 
     @Override
-    public String quoteIdentifier(String identifier) {
+    public String quoteIdentifier(final String identifier) {
         if (hasQuoteString) {
             return quoteString + identifier + quoteString;
         } else {

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimeMapper.java Tue May  3 06:52:51 2011
@@ -30,26 +30,25 @@ import org.apache.isis.runtimes.dflt.run
 
 public class JdbcTimeMapper extends AbstractJdbcFieldMapping {
 
-	public static class Factory implements FieldMappingFactory {
-		@Override
-		public FieldMapping createFieldMapping(final ObjectAssociation field) {
-			return new JdbcTimeMapper(field);
-		}
-	}
-
-	protected JdbcTimeMapper(ObjectAssociation field) {
-		super(field);
-	}
+    public static class Factory implements FieldMappingFactory {
+        @Override
+        public FieldMapping createFieldMapping(final ObjectAssociation field) {
+            return new JdbcTimeMapper(field);
+        }
+    }
+
+    protected JdbcTimeMapper(final ObjectAssociation field) {
+        super(field);
+    }
 
     @Override
-	protected Object preparedStatementObject(ObjectAdapter value){
-        Time asTime = (Time) value.getObject();
+    protected Object preparedStatementObject(final ObjectAdapter value) {
+        final Time asTime = (Time) value.getObject();
         return asTime.asJavaTime();
-	}
+    }
 
-	@Override
-	public ObjectAdapter setFromDBColumn(Results results,
-			String columnName, final ObjectAssociation field) {
+    @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
@@ -58,18 +57,18 @@ public class JdbcTimeMapper extends Abst
         ObjectAdapter restoredValue;
         final Class<?> correspondingClass = field.getSpecification().getCorrespondingClass();
         if (correspondingClass == Time.class) {
-            Time timeValue = results.getTime(columnName);
+            final Time timeValue = results.getTime(columnName);
             restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(timeValue);
         } else {
             throw new PersistFailedException("Unhandled time type: " + correspondingClass.getCanonicalName());
         }
         return restoredValue;
 
-	}
+    }
 
-	@Override
-	public String columnType() {
+    @Override
+    public String columnType() {
         return JdbcConnector.TYPE_TIME;
-	}
+    }
 
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/JdbcTimestampMapper.java Tue May  3 06:52:51 2011
@@ -36,30 +36,31 @@ public class JdbcTimestampMapper extends
         }
     }
 
-    protected JdbcTimestampMapper(ObjectAssociation field) {
+    protected JdbcTimestampMapper(final ObjectAssociation field) {
         super(field);
     }
 
     @Override
-    protected Object preparedStatementObject(ObjectAdapter value) {
-        TimeStamp asDate = (TimeStamp) value.getObject();
-        java.sql.Timestamp timeStamp = new java.sql.Timestamp(asDate.longValue());
+    protected Object preparedStatementObject(final ObjectAdapter value) {
+        final TimeStamp asDate = (TimeStamp) value.getObject();
+        final java.sql.Timestamp timeStamp = new java.sql.Timestamp(asDate.longValue());
         return timeStamp;
     }
 
     @Override
-    public ObjectAdapter setFromDBColumn(Results results, String columnName, final ObjectAssociation field) {
-        String encodedValue = results.getString(columnName);
-        if (encodedValue == null)
+    public ObjectAdapter setFromDBColumn(final Results results, final String columnName, final ObjectAssociation field) {
+        final String encodedValue = results.getString(columnName);
+        if (encodedValue == null) {
             return null;
+        }
         // convert date to yyyymmddhhmm
-        String year = encodedValue.substring(0, 4);
-        String month = encodedValue.substring(5, 7);
-        String day = encodedValue.substring(8, 10);
-        String hour = encodedValue.substring(11, 13);
-        String minute = encodedValue.substring(14, 16);
-        String second = encodedValue.substring(17, 19);
-        int length = encodedValue.length();
+        final String year = encodedValue.substring(0, 4);
+        final String month = encodedValue.substring(5, 7);
+        final String day = encodedValue.substring(8, 10);
+        final String hour = encodedValue.substring(11, 13);
+        final String minute = encodedValue.substring(14, 16);
+        final String second = encodedValue.substring(17, 19);
+        final int length = encodedValue.length();
         String millisecond;
         if (length > 20) {
             millisecond = encodedValue.substring(20, length);
@@ -73,7 +74,7 @@ public class JdbcTimestampMapper extends
         } else if (length < 23) {
             millisecond = millisecond + "0";
         }
-        String valueString = year + month + day + "T" + hour + minute + second + millisecond;
+        final String valueString = year + month + day + "T" + hour + minute + second + millisecond;
         return field.getSpecification().getFacet(EncodableFacet.class).fromEncodedString(valueString);
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/installer/JdbcFieldMappingFactoryInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/installer/JdbcFieldMappingFactoryInstaller.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/installer/JdbcFieldMappingFactoryInstaller.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/jdbc/installer/JdbcFieldMappingFactoryInstaller.java Tue May  3 06:52:51 2011
@@ -44,7 +44,7 @@ import org.apache.isis.runtimes.dflt.obj
 public class JdbcFieldMappingFactoryInstaller implements FieldMappingFactoryInstaller {
 
     @Override
-    public void load(FieldMappingLookup lookup) {
+    public void load(final FieldMappingLookup lookup) {
         lookup.addFieldMappingFactory(boolean.class, new JdbcBinaryValueMapper.Factory(JdbcConnector.TYPE_BOOLEAN()));
         lookup.addFieldMappingFactory(short.class, new JdbcBinaryValueMapper.Factory(JdbcConnector.TYPE_SHORT()));
         lookup.addFieldMappingFactory(int.class, new JdbcBinaryValueMapper.Factory(JdbcConnector.TYPE_INT()));

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMapping.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMapping.java Tue May  3 06:52:51 2011
@@ -17,29 +17,26 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.mapping;
 
-import org.apache.isis.runtimes.dflt.objectstores.sql.DatabaseConnector;
-import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-
+import org.apache.isis.runtimes.dflt.objectstores.sql.DatabaseConnector;
+import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 
 public interface FieldMapping {
     void appendColumnDefinitions(StringBuffer sql);
-    
+
     void appendColumnNames(StringBuffer sql);
 
     void appendInsertValues(DatabaseConnector connector, StringBuffer sql, ObjectAdapter object);
 
     void appendUpdateValues(DatabaseConnector connector, StringBuffer sql, ObjectAdapter object);
-    
+
     void initializeField(ObjectAdapter object, Results rs);
 
     void appendWhereClause(DatabaseConnector connector, StringBuffer sql, ObjectAdapter object);
 
     void debugData(DebugBuilder debug);
 
-
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMappingFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMappingFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/FieldMappingFactory.java Tue May  3 06:52:51 2011
@@ -17,13 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.mapping;
 
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 
-
 public interface FieldMappingFactory {
     FieldMapping createFieldMapping(final ObjectAssociation field);
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMapping.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMapping.java Tue May  3 06:52:51 2011
@@ -17,15 +17,13 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.mapping;
 
-import org.apache.isis.runtimes.dflt.objectstores.sql.DatabaseConnector;
-import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 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;
-
+import org.apache.isis.runtimes.dflt.objectstores.sql.DatabaseConnector;
+import org.apache.isis.runtimes.dflt.objectstores.sql.Results;
 
 public interface ObjectReferenceMapping {
 
@@ -38,6 +36,5 @@ public interface ObjectReferenceMapping 
     void appendUpdateValues(DatabaseConnector connector, StringBuffer sql, ObjectAdapter object);
 
     Oid recreateOid(final Results rs, final ObjectSpecification specification);
-        
-}
 
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMappingFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMappingFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/mapping/ObjectReferenceMappingFactory.java Tue May  3 06:52:51 2011
@@ -17,13 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.mapping;
 
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
-
 public interface ObjectReferenceMappingFactory {
     ObjectReferenceMapping createReferenceMapping(String columnName, ObjectSpecification specification);
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidTest.java Tue May  3 06:52:51 2011
@@ -17,24 +17,20 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import junit.framework.TestCase;
 
-import org.apache.isis.runtimes.dflt.objectstores.sql.IntegerPrimaryKey;
-import org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid;
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.State;
 
-
 public class SqlOidTest extends TestCase {
 
     /*
      * Test method for 'org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.hashCode()'
      */
     public void testHashCode() {
-        SqlOid oid1 = new SqlOid("className", new IntegerPrimaryKey(13), State.TRANSIENT);
-        SqlOid oid2 = new SqlOid("className", new IntegerPrimaryKey(13), State.TRANSIENT);
+        final SqlOid oid1 = new SqlOid("className", new IntegerPrimaryKey(13), State.TRANSIENT);
+        final SqlOid oid2 = new SqlOid("className", new IntegerPrimaryKey(13), State.TRANSIENT);
 
         assertEquals(oid1.hashCode(), oid2.hashCode());
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java Tue May  3 06:52:51 2011
@@ -33,10 +33,6 @@ import java.util.Properties;
 
 import junit.framework.TestCase;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.junit.Test;
-
 import org.apache.isis.applib.value.Color;
 import org.apache.isis.applib.value.Date;
 import org.apache.isis.applib.value.DateTime;
@@ -53,6 +49,9 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SimpleClass;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SimpleClassTwo;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SqlDataClass;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Test;
 
 /**
  * @author Kevin kevin@kmz.co.za
@@ -91,7 +90,7 @@ public abstract class SqlIntegrationTest
          * cal.set(Calendar.MONTH, 4-1); cal.set(Calendar.DAY_OF_MONTH, 8);
          */
         // 2011-4-8 = 1270684800000
-        Date date20100308 = new Date(2010, 4, 8);
+        final Date date20100308 = new Date(2010, 4, 8);
         sqlDate = new java.sql.Date(date20100308.getMillisSinceEpoch());
     }
 
@@ -141,12 +140,12 @@ public abstract class SqlIntegrationTest
 
     public Properties getProperties() {
         try {
-            Properties properties = new Properties();
+            final Properties properties = new Properties();
             properties.load(new FileInputStream("src/test/config/" + getPropertiesFilename()));
             return properties;
-        } catch (FileNotFoundException e) {
+        } catch (final FileNotFoundException e) {
             e.printStackTrace();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             e.printStackTrace();
         }
 
@@ -190,14 +189,14 @@ public abstract class SqlIntegrationTest
 
         // Initialise the framework
         if (getSingletonInstance().getState() == 0) {
-            Properties properties = getProperties();
+            final Properties properties = getProperties();
             if (properties == null) {
                 getSingletonInstance().initNOF("src/test/config", getPropertiesFilename());
             } else {
                 getSingletonInstance().initNOF(properties);
             }
 
-            String sqlSetupString = getSqlSetupString();
+            final String sqlSetupString = getSqlSetupString();
             if (sqlSetupString != null) {
                 getSingletonInstance().sqlExecute(sqlSetupString);
             }
@@ -208,11 +207,11 @@ public abstract class SqlIntegrationTest
     @Override
     public void tearDown() {
         if (getSingletonInstance().getState() == 0) {
-            String sqlTeardownString = getSqlTeardownString();
+            final String sqlTeardownString = getSqlTeardownString();
             if (sqlTeardownString != null) {
                 try {
                     getSingletonInstance().sqlExecute(sqlTeardownString);
-                } catch (SQLException e) {
+                } catch (final SQLException e) {
                     e.printStackTrace();
                 }
             }
@@ -238,8 +237,8 @@ public abstract class SqlIntegrationTest
         SqlIntegrationTestSingleton.drop(getSimpleClassTableName());
         SqlIntegrationTestSingleton.drop(getSimpleClassTwoTableName());
 
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        SqlDataClass sqlDataClass = factory.newDataClass();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final SqlDataClass sqlDataClass = factory.newDataClass();
         sqlDataClass.setString("Test String");
         sqlDataClass.setDate(applibDate);
         sqlDataClass.setSqlDate(sqlDate);
@@ -289,8 +288,8 @@ public abstract class SqlIntegrationTest
         if (simpleClassList1.size() == 0) {
             bMustAdd = true;
         }
-        for (String string : SqlIntegrationTestCommon.stringList1) {
-            SimpleClass simpleClass = factory.newSimpleClass();
+        for (final String string : SqlIntegrationTestCommon.stringList1) {
+            final SimpleClass simpleClass = factory.newSimpleClass();
             simpleClass.setString(string);
             simpleClass.setSimpleClassTwoA(simpleClassTwoA);
             sqlDataClass.addToSimpleClasses1(simpleClass);
@@ -301,8 +300,8 @@ public abstract class SqlIntegrationTest
 
         // Initialise collection2
         /**/
-        for (String string : SqlIntegrationTestCommon.stringList2) {
-            SimpleClass simpleClass = factory.newSimpleClass();
+        for (final String string : SqlIntegrationTestCommon.stringList2) {
+            final SimpleClass simpleClass = factory.newSimpleClass();
             simpleClass.setString(string);
             simpleClass.setSimpleClassTwoA(simpleClassTwoA);
             sqlDataClass.addToSimpleClasses2(simpleClass);
@@ -327,17 +326,17 @@ public abstract class SqlIntegrationTest
      * @throws Exception
      */
     public void testLoad() throws Exception {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        List<SqlDataClass> dataClasses = factory.allDataClasses();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final List<SqlDataClass> dataClasses = factory.allDataClasses();
         assertEquals(1, dataClasses.size());
-        SqlDataClass sqlDataClass = dataClasses.get(0);
+        final SqlDataClass sqlDataClass = dataClasses.get(0);
         SqlIntegrationTestSingleton.setDataClass(sqlDataClass);
         getSingletonInstance().setState(1);
     }
 
     public void testSimpleClassCollection1Lazy() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        List<SimpleClass> collection = sqlDataClass.simpleClasses1;
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final List<SimpleClass> collection = sqlDataClass.simpleClasses1;
 
         assertEquals("collection size is not equal!", collection.size(), simpleClassList1.size());
     }
@@ -348,7 +347,7 @@ public abstract class SqlIntegrationTest
      * @throws Exception
      */
     public void testString() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertEquals("Test String", sqlDataClass.getString());
     }
 
@@ -358,7 +357,7 @@ public abstract class SqlIntegrationTest
      * @throws Exception
      */
     public void testApplibDate() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
 
         // LOG.log(Level.INFO, "Test: testDate() '2010-3-5' = 1267747200000");
 
@@ -390,7 +389,7 @@ public abstract class SqlIntegrationTest
     /* */
     @Test
     public void testSqlDate() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
 
         // LOG.log(Level.INFO, "Test: testSqlDate() '2011-4-8' == 1302220800000");
 
@@ -444,7 +443,7 @@ public abstract class SqlIntegrationTest
      */
 
     public void testMoney() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertEquals(money, sqlDataClass.getMoney());
         // assertTrue("Money " + money.toString() + " is not equal to " + sqlDataClass.getMoney().toString(),
         // money.equals(sqlDataClass.getMoney()));
@@ -454,7 +453,7 @@ public abstract class SqlIntegrationTest
      * Test {@link DateTime} type.
      */
     public void testDateTime() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
 
         LOG.log(Level.INFO, "Test: testDateTime()");
         LOG.log(Level.INFO, "sqlDataClass.getDateTime() as String:" + sqlDataClass.getDateTime());
@@ -473,7 +472,7 @@ public abstract class SqlIntegrationTest
      * Test {@link TimeStamp} type.
      */
     public void testTimeStamp() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertTrue("TimeStamp " + timeStamp.toString() + " is not equal to " + sqlDataClass.getTimeStamp().toString(),
             timeStamp.isEqualTo(sqlDataClass.getTimeStamp()));
     }
@@ -483,7 +482,7 @@ public abstract class SqlIntegrationTest
      */
     /**/
     public void testTime() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertNotNull("sqlDataClass is null", sqlDataClass);
         assertNotNull("getTime() is null", sqlDataClass.getTime());
         assertTrue("Time 14h56: expected " + time.toString() + ", but got " + sqlDataClass.getTime().toString(),
@@ -496,7 +495,7 @@ public abstract class SqlIntegrationTest
      * Test {@link Color} type.
      */
     public void testColor() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertEquals(color, sqlDataClass.getColor());
         // assertTrue("Color Black, expected " + color.toString() + " but got " + sqlDataClass.getColor().toString(),
         // color.isEqualTo(sqlDataClass.getColor()));
@@ -522,7 +521,7 @@ public abstract class SqlIntegrationTest
      * Test {@link Password} type.
      */
     public void testPassword() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertEquals(password, sqlDataClass.getPassword());
     }
 
@@ -530,13 +529,13 @@ public abstract class SqlIntegrationTest
      * Test {@link Percentage} type.
      */
     public void testPercentage() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
         assertEquals(percentage, sqlDataClass.getPercentage());
     }
 
     public void testStandardValueTypesMaxima() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        NumericTestClass numericTestMaxClass = sqlDataClass.getNumericTestClassMax();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final NumericTestClass numericTestMaxClass = sqlDataClass.getNumericTestClassMax();
 
         assertEquals(shortMaxValue, numericTestMaxClass.getShortValue());
         assertEquals(intMaxValue, numericTestMaxClass.getIntValue());
@@ -546,8 +545,8 @@ public abstract class SqlIntegrationTest
     }
 
     public void testStandardValueTypesMinima() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        NumericTestClass numericTestMinClass = sqlDataClass.getNumericTestClassMin();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final NumericTestClass numericTestMinClass = sqlDataClass.getNumericTestClassMin();
 
         assertEquals(shortMinValue, numericTestMinClass.getShortValue());
         assertEquals(intMinValue, numericTestMinClass.getIntValue());
@@ -566,8 +565,8 @@ public abstract class SqlIntegrationTest
      */
 
     public void testSingleReferenceLazy() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        SimpleClassTwo a = sqlDataClass.getSimpleClassTwo();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SimpleClassTwo a = sqlDataClass.getSimpleClassTwo();
         if (getProperties().getProperty("isis.persistor") != "in-memory") {
             assertEquals(null, a.text); // must check direct value, as
             // framework can auto-resolve, if you use getText()
@@ -578,14 +577,14 @@ public abstract class SqlIntegrationTest
      * Test a collection of {@link SimpleClass} type.
      */
     public void testSimpleClassCollection1() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
 
         assertEquals("collection size is not equal!", SqlIntegrationTestCommon.simpleClassList1.size(),
             collection.size());
 
         int i = 0;
-        for (SimpleClass simpleClass : SqlIntegrationTestCommon.simpleClassList1) {
+        for (final SimpleClass simpleClass : SqlIntegrationTestCommon.simpleClassList1) {
             assertEquals(simpleClass.getString(), collection.get(i++).getString());
         }
     }
@@ -595,24 +594,24 @@ public abstract class SqlIntegrationTest
      */
     /**/
     public void testSimpleClassCollection2() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        List<SimpleClass> collection = sqlDataClass.getSimpleClasses2();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final List<SimpleClass> collection = sqlDataClass.getSimpleClasses2();
 
         assertEquals("collection size is not equal!", SqlIntegrationTestCommon.simpleClassList2.size(),
             collection.size());
 
         int i = 0;
-        for (SimpleClass simpleClass : SqlIntegrationTestCommon.simpleClassList2) {
+        for (final SimpleClass simpleClass : SqlIntegrationTestCommon.simpleClassList2) {
             assertEquals(simpleClass.getString(), collection.get(i++).getString());
         }
     }
 
     public void testSimpleClassTwoReferenceLazy() {
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
         if (getProperties().getProperty("isis.persistor") != "in-memory") {
-            for (SimpleClass simpleClass : collection) {
-                SimpleClassTwo a = simpleClass.getSimpleClassTwoA();
+            for (final SimpleClass simpleClass : collection) {
+                final SimpleClassTwo a = simpleClass.getSimpleClassTwoA();
                 assertEquals(null, a.text); // must check direct value, as
                                             // framework can auto-resolve, if
                                             // you use getText()
@@ -621,19 +620,19 @@ public abstract class SqlIntegrationTest
     }
 
     public void testSingleReferenceResolve() {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        SimpleClassTwo a = sqlDataClass.getSimpleClassTwo();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final SimpleClassTwo a = sqlDataClass.getSimpleClassTwo();
         factory.resolve(a);
         assertEquals(simpleClassTwoA.getText(), a.getText());
     }
 
     public void testSimpleClassTwoReferenceResolve() {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
-        List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
-        for (SimpleClass simpleClass : collection) {
-            SimpleClassTwo a = simpleClass.getSimpleClassTwoA();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
+        final List<SimpleClass> collection = sqlDataClass.getSimpleClasses1();
+        for (final SimpleClass simpleClass : collection) {
+            final SimpleClassTwo a = simpleClass.getSimpleClassTwoA();
             factory.resolve(a);
             assertEquals(simpleClassTwoA.getText(), a.getText());
             assertEquals(simpleClassTwoA.getIntValue(), a.getIntValue());
@@ -642,31 +641,31 @@ public abstract class SqlIntegrationTest
     }
 
     public void testSimpleClassTwo() {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
         assertEquals(1, classes.size());
-        for (SimpleClassTwo simpleClass : classes) {
+        for (final SimpleClassTwo simpleClass : classes) {
             assertEquals(simpleClassTwoA.getText(), simpleClass.getText());
         }
     }
 
     public void testUpdate1() {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
         assertEquals(1, classes.size());
 
-        SimpleClassTwo simpleClass = classes.get(0);
+        final SimpleClassTwo simpleClass = classes.get(0);
         simpleClass.setText("XXX");
         simpleClass.setBooleanValue(false);
         simpleClassTwoA.setBooleanValue(false);
     }
 
     public void testUpdate2() {
-        SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
-        List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
+        final SqlDataClassFactory factory = SqlIntegrationTestSingleton.getSqlDataClassFactory();
+        final List<SimpleClassTwo> classes = factory.allSimpleClassTwos();
         assertEquals(1, classes.size());
 
-        SimpleClassTwo simpleClass = classes.get(0);
+        final SimpleClassTwo simpleClass = classes.get(0);
         assertEquals("XXX", simpleClass.getText());
         assertEquals(simpleClassTwoA.getBooleanValue(), simpleClass.getBooleanValue());
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/singleton/SqlIntegrationTestSingleton.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/singleton/SqlIntegrationTestSingleton.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/singleton/SqlIntegrationTestSingleton.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/singleton/SqlIntegrationTestSingleton.java Tue May  3 06:52:51 2011
@@ -17,180 +17,190 @@
  *  under the License.
  */
 
+/**
+ * 
+ */
+package org.apache.isis.runtimes.dflt.objectstores.sql.singleton;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+import java.util.Properties;
 
-/**
- * 
- */
-package org.apache.isis.runtimes.dflt.objectstores.sql.singleton;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.List;
-import java.util.Properties;
-
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.SqlDataClassFactory;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.TestProxySystemIII;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SimpleClass;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SimpleClassTwo;
 import org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SqlDataClass;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-
-/**
- * @author Kevin
- *
- */
-public class SqlIntegrationTestSingleton {
-	static SqlIntegrationTestSingleton instance;
-	public static  SqlIntegrationTestSingleton getInstance(){
-		if (instance == null){
-			instance = new SqlIntegrationTestSingleton();
-		}
-		return instance;
-	}
-	
-	
-	private int state = 0;
-	public int getState() {
-		return state;
-	}
-	public void setState(int state) {
-		this.state = state;
-	}
-	private String persistorName;
-	private SqlDataClassFactory sqlDataClassFactory = null;
-	private TestProxySystemIII system = null;
-	public void initNOF(String propertiesDirectory, String propertiesFileName) throws FileNotFoundException, IOException,
-		SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
-		
-		Properties properties = new Properties();
-		properties.load(new FileInputStream(propertiesDirectory+"/"+propertiesFileName));
-		this.initNOF(properties);
-	}
-	
-	public void initNOF(Properties properties) throws  SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
-		IsisConfigurationDefault configuration = new IsisConfigurationDefault();
-		configuration.add(properties);
-        persistorName = configuration.getString("isis.persistor");
-        
-		resetPersistorState(configuration);
-
-		sqlDataClassFactory = new SqlDataClassFactory();
-		if (system != null){
-			system.shutDown();
-		}
-        system = new TestProxySystemIII();
-        system.setConfiguration(configuration);
-        system.init(sqlDataClassFactory);
-	}
-
-    // JDBC
-    private Connection c = null;
-    private Statement s = null;
-	private SqlDataClass sqlDataClass;
-    
-	@SuppressWarnings("unchecked")
-	private void resetPersistorState(IsisConfigurationDefault IsisConfigurationDefault) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
-		String jdbcClassName = IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.driver");
-		if (jdbcClassName == null){
-			c = null;
-			s = null;
-			return;
-		}
-		Class<Driver> driverClass = (Class<Driver>) Class.forName(jdbcClassName);
-		Driver driver = driverClass.newInstance();
-		DriverManager.registerDriver(driver);
-		
-        // jdbc - connect to DB and drop tables.
-    	c = DriverManager.getConnection(
-	    		IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.connection"),
-                IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.user"), 
-                IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.password"));
-		s = c.createStatement();
-			
-	    dropTable(SqlObjectStore.getTableName());
-	}
-	private void dropTable(String tableName) {
-		if (s == null){
-			if (persistorName == "xml"){
-				// Delete the xml files..
-			}
-			
-			if (tableName.equalsIgnoreCase("sqldataclass")){
-				List<SqlDataClass> list = sqlDataClassFactory.allDataClasses();
-				for (SqlDataClass sqlDataClass : list) {
-					sqlDataClassFactory.delete(sqlDataClass);
-				}
-				return;
-			}
-			if (tableName.equalsIgnoreCase("simpleclass")){
-				List<SimpleClass> list = sqlDataClassFactory.allSimpleClasses();
-				for (SimpleClass sqlClass : list) {
-					sqlDataClassFactory.delete(sqlClass);
-				}
-				return;
-			}
-            if (tableName.equalsIgnoreCase("simpleclasstwo")){
-                List<SimpleClassTwo> list = sqlDataClassFactory.allSimpleClassTwos();
-                for (SimpleClassTwo sqlClass : list) {
+
+/**
+ * @author Kevin
+ * 
+ */
+public class SqlIntegrationTestSingleton {
+    static SqlIntegrationTestSingleton instance;
+
+    public static SqlIntegrationTestSingleton getInstance() {
+        if (instance == null) {
+            instance = new SqlIntegrationTestSingleton();
+        }
+        return instance;
+    }
+
+    private int state = 0;
+
+    public int getState() {
+        return state;
+    }
+
+    public void setState(final int state) {
+        this.state = state;
+    }
+
+    private String persistorName;
+    private SqlDataClassFactory sqlDataClassFactory = null;
+    private TestProxySystemIII system = null;
+
+    public void initNOF(final String propertiesDirectory, final String propertiesFileName)
+        throws FileNotFoundException, IOException, SQLException, ClassNotFoundException, InstantiationException,
+        IllegalAccessException {
+
+        final Properties properties = new Properties();
+        properties.load(new FileInputStream(propertiesDirectory + "/" + propertiesFileName));
+        this.initNOF(properties);
+    }
+
+    public void initNOF(final Properties properties) throws SQLException, ClassNotFoundException,
+        InstantiationException, IllegalAccessException {
+        final IsisConfigurationDefault configuration = new IsisConfigurationDefault();
+        configuration.add(properties);
+        persistorName = configuration.getString("isis.persistor");
+
+        resetPersistorState(configuration);
+
+        sqlDataClassFactory = new SqlDataClassFactory();
+        if (system != null) {
+            system.shutDown();
+        }
+        system = new TestProxySystemIII();
+        system.setConfiguration(configuration);
+        system.init(sqlDataClassFactory);
+    }
+
+    // JDBC
+    private Connection c = null;
+    private Statement s = null;
+    private SqlDataClass sqlDataClass;
+
+    @SuppressWarnings("unchecked")
+    private void resetPersistorState(final IsisConfigurationDefault IsisConfigurationDefault) throws SQLException,
+        ClassNotFoundException, InstantiationException, IllegalAccessException {
+        final String jdbcClassName = IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.driver");
+        if (jdbcClassName == null) {
+            c = null;
+            s = null;
+            return;
+        }
+        final Class<Driver> driverClass = (Class<Driver>) Class.forName(jdbcClassName);
+        final Driver driver = driverClass.newInstance();
+        DriverManager.registerDriver(driver);
+
+        // jdbc - connect to DB and drop tables.
+        c =
+            DriverManager.getConnection(
+                IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.connection"),
+                IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.user"),
+                IsisConfigurationDefault.getString(SqlObjectStore.BASE_NAME + ".jdbc.password"));
+        s = c.createStatement();
+
+        dropTable(SqlObjectStore.getTableName());
+    }
+
+    private void dropTable(final String tableName) {
+        if (s == null) {
+            if (persistorName == "xml") {
+                // Delete the xml files..
+            }
+
+            if (tableName.equalsIgnoreCase("sqldataclass")) {
+                final List<SqlDataClass> list = sqlDataClassFactory.allDataClasses();
+                for (final SqlDataClass sqlDataClass : list) {
+                    sqlDataClassFactory.delete(sqlDataClass);
+                }
+                return;
+            }
+            if (tableName.equalsIgnoreCase("simpleclass")) {
+                final List<SimpleClass> list = sqlDataClassFactory.allSimpleClasses();
+                for (final SimpleClass sqlClass : list) {
                     sqlDataClassFactory.delete(sqlClass);
                 }
                 return;
             }
-			return;
-		}
-		/**/
-		try {
-			s.executeUpdate("DROP TABLE "+tableName+"");
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		/**/
-	}
-	
-	public void sqlExecute(String sqlString) throws SQLException{
-		if (s != null){
-			s.executeUpdate(sqlString);
-		}
-	}
-
-	public static SqlDataClassFactory getSqlDataClassFactory(){
-		return getInstance().sqlDataClassFactory;
-	}
-    
-	public static void drop(String tableName){
-		getInstance().dropTable(tableName);
-	}
-	
-	public void shutDown(){
-		if (system != null){
-			system.shutDown();
-		}
-	}
-	
-	public static void setDataClass(SqlDataClass person) {
-		getInstance().setSqlDataClass(person);
-		
-	}
-	public static SqlDataClass getDataClass() {
-		return getInstance().getSqlDataClass();
-		
-	}
-	
-	private void setSqlDataClass(SqlDataClass person) {
-		this.sqlDataClass = person;
-		
-	}
-	/**
-	 * @return the sqlDataClass
-	 */
-	public SqlDataClass getSqlDataClass() {
-		return sqlDataClass;
-	}
-}
+            if (tableName.equalsIgnoreCase("simpleclasstwo")) {
+                final List<SimpleClassTwo> list = sqlDataClassFactory.allSimpleClassTwos();
+                for (final SimpleClassTwo sqlClass : list) {
+                    sqlDataClassFactory.delete(sqlClass);
+                }
+                return;
+            }
+            return;
+        }
+        /**/
+        try {
+            s.executeUpdate("DROP TABLE " + tableName + "");
+        } catch (final SQLException e) {
+            e.printStackTrace();
+        }
+        /**/
+    }
+
+    public void sqlExecute(final String sqlString) throws SQLException {
+        if (s != null) {
+            s.executeUpdate(sqlString);
+        }
+    }
+
+    public static SqlDataClassFactory getSqlDataClassFactory() {
+        return getInstance().sqlDataClassFactory;
+    }
+
+    public static void drop(final String tableName) {
+        getInstance().dropTable(tableName);
+    }
+
+    public void shutDown() {
+        if (system != null) {
+            system.shutDown();
+        }
+    }
+
+    public static void setDataClass(final SqlDataClass person) {
+        getInstance().setSqlDataClass(person);
+
+    }
+
+    public static SqlDataClass getDataClass() {
+        return getInstance().getSqlDataClass();
+
+    }
+
+    private void setSqlDataClass(final SqlDataClass person) {
+        this.sqlDataClass = person;
+
+    }
+
+    /**
+     * @return the sqlDataClass
+     */
+    public SqlDataClass getSqlDataClass() {
+        return sqlDataClass;
+    }
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/SqlDataClassFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/SqlDataClassFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/SqlDataClassFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/SqlDataClassFactory.java Tue May  3 06:52:51 2011
@@ -40,7 +40,7 @@ public class SqlDataClassFactory extends
     }
 
     public SqlDataClass newDataClass() {
-        SqlDataClass object = newTransientInstance(SqlDataClass.class);
+        final SqlDataClass object = newTransientInstance(SqlDataClass.class);
         return object;
     }
 
@@ -50,7 +50,7 @@ public class SqlDataClassFactory extends
     }
 
     public SimpleClass newSimpleClass() {
-        SimpleClass object = newTransientInstance(SimpleClass.class);
+        final SimpleClass object = newTransientInstance(SimpleClass.class);
         return object;
     }
 
@@ -60,20 +60,20 @@ public class SqlDataClassFactory extends
     }
 
     public SimpleClassTwo newSimpleClassTwo() {
-        SimpleClassTwo object = newTransientInstance(SimpleClassTwo.class);
+        final SimpleClassTwo object = newTransientInstance(SimpleClassTwo.class);
         return object;
     }
 
     public NumericTestClass newNumericTestClass() {
-        NumericTestClass object = newTransientInstance(NumericTestClass.class);
+        final NumericTestClass object = newTransientInstance(NumericTestClass.class);
         return object;
     }
 
-    public void save(Object sqlDataClass) {
+    public void save(final Object sqlDataClass) {
         persistIfNotAlready(sqlDataClass);
     }
 
-    public void delete(Object sqlDataClass) {
+    public void delete(final Object sqlDataClass) {
         remove(sqlDataClass);
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/TestProxySystemIII.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/TestProxySystemIII.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/TestProxySystemIII.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/TestProxySystemIII.java Tue May  3 06:52:51 2011
@@ -17,21 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql.testsystem;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.jmock.lib.legacy.ClassImposteriser;
-
-import org.apache.isis.progmodels.dflt.JavaReflectorInstaller;
-import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore;
-import org.apache.isis.runtimes.dflt.objectstores.sql.SqlPersistorInstaller;
-import org.apache.isis.runtimes.dflt.objectstores.xml.XmlPersistenceMechanismInstaller;
 import org.apache.isis.applib.AbstractFactoryAndRepository;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.metamodel.spec.SpecificationLoader;
@@ -41,6 +31,11 @@ import org.apache.isis.core.runtime.auth
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
 import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
+import org.apache.isis.progmodels.dflt.JavaReflectorInstaller;
+import org.apache.isis.runtimes.dflt.objectstores.dflt.InMemoryPersistenceMechanismInstaller;
+import org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStore;
+import org.apache.isis.runtimes.dflt.objectstores.sql.SqlPersistorInstaller;
+import org.apache.isis.runtimes.dflt.objectstores.xml.XmlPersistenceMechanismInstaller;
 import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.ObjectStorePersistenceMechanismInstallerAbstract;
 import org.apache.isis.runtimes.dflt.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
@@ -48,35 +43,39 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContextStatic;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.isis.runtimes.dflt.objectstores.dflt.InMemoryPersistenceMechanismInstaller;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
 
 /*
  * TODO allow to be created with specific requirements for components being set up rather than using mocks.
  */
 public class TestProxySystemIII {
-    
+
     private IsisConfigurationDefault configuration;
-    public void setConfiguration(IsisConfigurationDefault configuration) {
-		this.configuration = configuration;
-	}
+
+    public void setConfiguration(final IsisConfigurationDefault configuration) {
+        this.configuration = configuration;
+    }
+
     public IsisConfigurationDefault getConfiguration() {
-        if (configuration == null){
-        	configuration = new IsisConfigurationDefault();
+        if (configuration == null) {
+            configuration = new IsisConfigurationDefault();
         }
         return configuration;
     }
 
+    private List<Object> servicesList;
+    private final Mockery mockery = new JUnit4Mockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+    private IsisSessionFactoryDefault sessionFactory = null;
+    private ObjectStorePersistenceMechanismInstallerAbstract persistenceMechanismInstaller;
 
-	private List<Object> servicesList;
-    private Mockery mockery = new JUnit4Mockery(){{
-        setImposteriser(ClassImposteriser.INSTANCE);
-    }};
-	private IsisSessionFactoryDefault sessionFactory = null;
-	private ObjectStorePersistenceMechanismInstallerAbstract persistenceMechanismInstaller;
-    
-    
-    
-    public void init(AbstractFactoryAndRepository factory) {
+    public void init(final AbstractFactoryAndRepository factory) {
         servicesList = new ArrayList<Object>();
         servicesList.add(factory);
 
@@ -95,54 +94,47 @@ public class TestProxySystemIII {
         });
 
         SpecificationLoader mockSpecificationLoader;
-        JavaReflectorInstaller javaReflectorInstaller = new JavaReflectorInstaller();
+        final JavaReflectorInstaller javaReflectorInstaller = new JavaReflectorInstaller();
         javaReflectorInstaller.setConfiguration(configuration);
         mockSpecificationLoader = javaReflectorInstaller.createReflector();
 
         ((ObjectReflectorDefault) mockSpecificationLoader).setRuntimeContext(new RuntimeContextFromSession());
 
-        if (configuration.getString(SqlObjectStore.BASE_NAME + ".jdbc.driver") == null){
-        	if (configuration.getString("isis.persistor") == "in-memory"){
-        		persistenceMechanismInstaller = new InMemoryPersistenceMechanismInstaller();
-        	} else {
-        		persistenceMechanismInstaller = new XmlPersistenceMechanismInstaller();
-        	}
+        if (configuration.getString(SqlObjectStore.BASE_NAME + ".jdbc.driver") == null) {
+            if (configuration.getString("isis.persistor") == "in-memory") {
+                persistenceMechanismInstaller = new InMemoryPersistenceMechanismInstaller();
+            } else {
+                persistenceMechanismInstaller = new XmlPersistenceMechanismInstaller();
+            }
         } else {
-            persistenceMechanismInstaller = new SqlPersistorInstaller(); 
+            persistenceMechanismInstaller = new SqlPersistorInstaller();
         }
-        
+
         persistenceMechanismInstaller.setConfiguration(configuration);
-        PersistenceSessionFactory persistenceSessionFactory = persistenceMechanismInstaller.createPersistenceSessionFactory(DeploymentType.PROTOTYPE);
-        
-        sessionFactory = new IsisSessionFactoryDefault(
-                DeploymentType.EXPLORATION,
-                configuration, 
-                mockTemplateImageLoader, 
-                mockSpecificationLoader, 
-                mockAuthenticationManager,
-                mockAuthorizationManager, 
-                mockUserProfileLoader, 
-                persistenceSessionFactory, 
-                servicesList);
-        IsisContext context = IsisContextStatic.createRelaxedInstance(sessionFactory);
+        final PersistenceSessionFactory persistenceSessionFactory =
+            persistenceMechanismInstaller.createPersistenceSessionFactory(DeploymentType.PROTOTYPE);
+
+        sessionFactory =
+            new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, configuration, mockTemplateImageLoader,
+                mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader,
+                persistenceSessionFactory, servicesList);
+        final IsisContext context = IsisContextStatic.createRelaxedInstance(sessionFactory);
         IsisContext.setConfiguration(sessionFactory.getConfiguration());
         sessionFactory.init();
-        
+
         context.openSessionInstance(new SimpleSession("tester", new String[0], "001"));
     }
-    
-    public void addToConfiguration(String key, String value) {
+
+    public void addToConfiguration(final String key, final String value) {
         configuration.add(key, value);
     }
-    
-    public void shutDown(){
-    	if (sessionFactory != null){
-    		sessionFactory.shutdown();
-    	}
-    	if (persistenceMechanismInstaller != null){
-    		persistenceMechanismInstaller.shutdown();
-    	}
+
+    public void shutDown() {
+        if (sessionFactory != null) {
+            sessionFactory.shutdown();
+        }
+        if (persistenceMechanismInstaller != null) {
+            persistenceMechanismInstaller.shutdown();
+        }
     }
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/dataclasses/SimpleClass.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/dataclasses/SimpleClass.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/dataclasses/SimpleClass.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/testsystem/dataclasses/SimpleClass.java Tue May  3 06:52:51 2011
@@ -17,41 +17,45 @@
  *  under the License.
  */
 
+/**
+ * 
+ */
+package org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses;
+
+import org.apache.isis.applib.AbstractDomainObject;
+
+/**
+ * @author Kevin
+ * 
+ */
+public class SimpleClass extends AbstractDomainObject {
+    public String title() {
+        return string;
+    }
+
+    // {{ String type
+    private String string;
+
+    public String getString() {
+        return string;
+    }
+
+    public void setString(final String string) {
+        this.string = string;
+    }
+
+    // }}
+
+    // {{ SimpleClassTwoA
+    private SimpleClassTwo simplyClassTwoA;
+
+    public SimpleClassTwo getSimpleClassTwoA() {
+        return simplyClassTwoA;
+    }
+
+    public void setSimpleClassTwoA(final SimpleClassTwo simpleClassTwoA) {
+        this.simplyClassTwoA = simpleClassTwoA;
+    }
+    // }}
 
-/**
- * 
- */
-package org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses;
-
-import org.apache.isis.applib.AbstractDomainObject;
-
-/**
- * @author Kevin
- *
- */
-public class SimpleClass extends AbstractDomainObject {
-    public String title() {
-        return string;
-    }
-    // {{ String type
-    private String string;
-    public String getString() {
-        return string;
-    }
-    public void setString(final String string) {
-        this.string = string;
-    }
-    // }}
-
-    // {{ SimpleClassTwoA
-	private SimpleClassTwo simplyClassTwoA;
-	public SimpleClassTwo getSimpleClassTwoA() {
-		return simplyClassTwoA;
-	}
-	public void setSimpleClassTwoA(final SimpleClassTwo simpleClassTwoA) {
-		this.simplyClassTwoA = simpleClassTwoA;
-	}
-	// }}
-
-
-}
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/HsqlTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/HsqlTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/HsqlTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/HsqlTest.java Tue May  3 06:52:51 2011
@@ -17,57 +17,55 @@
  *  under the License.
  */
 
+/**
+ * 
+ */
+package org.apache.isis.runtimes.dflt.objectstores.sql;
+
+import java.util.Properties;
 
-/**
- * 
- */
-package org.apache.isis.runtimes.dflt.objectstores.sql;
-
-import java.util.Properties;
-
 import org.apache.isis.runtimes.dflt.objectstores.sql.common.SqlIntegrationTestCommon;
-
-
-
-
-public class HsqlTest extends SqlIntegrationTestCommon {
-
-	@Override
-	public Properties getProperties(){
-		Properties properties = super.getProperties();
-		if (properties == null){ // Only used if properties file does not exist.
-			properties = new Properties();
-			properties.put(SqlObjectStore.BASE_NAME + ".jdbc.driver", "org.hsqldb.jdbcDriver");
-			properties.put(SqlObjectStore.BASE_NAME + ".jdbc.connection", "jdbc:hsqldb:file:hsql-db/tests");
-			properties.put(SqlObjectStore.BASE_NAME + ".jdbc.user","sa");
-			properties.put(SqlObjectStore.BASE_NAME + ".jdbc.password", "");
-			properties.put("isis.logging.objectstore","on");
-		}
-		
-		return properties;
-	}
-	
-	public String getPropertiesFilename(){
-		return "hsql.properties";
-	}
-	
-	@Override
-	public
-	String getSqlTeardownString(){
-		return "SHUTDOWN;";
-	}
-	
+
+public class HsqlTest extends SqlIntegrationTestCommon {
+
+    @Override
+    public Properties getProperties() {
+        Properties properties = super.getProperties();
+        if (properties == null) { // Only used if properties file does not exist.
+            properties = new Properties();
+            properties.put(SqlObjectStore.BASE_NAME + ".jdbc.driver", "org.hsqldb.jdbcDriver");
+            properties.put(SqlObjectStore.BASE_NAME + ".jdbc.connection", "jdbc:hsqldb:file:hsql-db/tests");
+            properties.put(SqlObjectStore.BASE_NAME + ".jdbc.user", "sa");
+            properties.put(SqlObjectStore.BASE_NAME + ".jdbc.password", "");
+            properties.put("isis.logging.objectstore", "on");
+        }
+
+        return properties;
+    }
+
+    @Override
+    public String getPropertiesFilename() {
+        return "hsql.properties";
+    }
+
+    @Override
+    public String getSqlTeardownString() {
+        return "SHUTDOWN;";
+    }
+
+    @Override
     public String getPersonTableName() {
         return "ISIS_SQLDATACLASS";
     }
 
+    @Override
     public String getSimpleClassTableName() {
         return "ISIS_SIMPLECLASS";
     }
 
+    @Override
     public String getSimpleClassTwoTableName() {
         return "ISIS_SIMPLECLASSTWO";
     }
-	
-}
-
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/InMemoryPersistanceTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/InMemoryPersistanceTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/InMemoryPersistanceTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/InMemoryPersistanceTest.java Tue May  3 06:52:51 2011
@@ -17,37 +17,33 @@
  *  under the License.
  */
 
+/**
+ * 
+ */
+package org.apache.isis.runtimes.dflt.objectstores.sql.crosscheck;
+
+import java.util.Properties;
 
-/**
- * 
- */
-package org.apache.isis.runtimes.dflt.objectstores.sql.crosscheck;
-
-import java.util.Properties;
-
 import org.apache.isis.runtimes.dflt.objectstores.sql.common.SqlIntegrationTestCommon;
-
-
-
-
-public class InMemoryPersistanceTest extends SqlIntegrationTestCommon {
-	
-	@Override
-	public Properties getProperties(){
-		Properties properties = new Properties();
-		properties.put("isis.persistor", "in-memory");
-		properties.put("isis.logging.objectstore","on");
-		return properties;
-	}
-	
-	public  String getPropertiesFilename(){
-		return "inmemory.properties";
-	}
-	@Override
-	public String getSqlTeardownString(){
-		return "SHUTDOWN;";
-	}
-	
-	
-}
-
+
+public class InMemoryPersistanceTest extends SqlIntegrationTestCommon {
+
+    @Override
+    public Properties getProperties() {
+        final Properties properties = new Properties();
+        properties.put("isis.persistor", "in-memory");
+        properties.put("isis.logging.objectstore", "on");
+        return properties;
+    }
+
+    @Override
+    public String getPropertiesFilename() {
+        return "inmemory.properties";
+    }
+
+    @Override
+    public String getSqlTeardownString() {
+        return "SHUTDOWN;";
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/XmlPersistanceTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/XmlPersistanceTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/XmlPersistanceTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/XmlPersistanceTest.java Tue May  3 06:52:51 2011
@@ -17,62 +17,62 @@
  *  under the License.
  */
 
+/**
+ * 
+ */
+package org.apache.isis.runtimes.dflt.objectstores.sql.crosscheck;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Properties;
 
-/**
- * 
- */
-package org.apache.isis.runtimes.dflt.objectstores.sql.crosscheck;
-
-import java.util.Properties;
-
 import org.apache.isis.runtimes.dflt.objectstores.sql.common.SqlIntegrationTestCommon;
 
-import java.io.*;
-
-
-
-
-public class XmlPersistanceTest extends SqlIntegrationTestCommon {
-
-	  public static void deleteFiles( String directory, FilenameFilter extension ) {
-		    File dir = new File(directory);
-
-		    String[] list = dir.list(extension);
-		    File file;
-		    if (list.length == 0) return;
-
-		    for (int i = 0; i < list.length; i++) {
-		      file = new File(directory, list[i]);
-		      file.delete();
-		    }
-	  }
-	
-	public void initialiseTests() {
-		// Delete all XML files.
-		deleteFiles("xml/objects", new FilenameFilter() {
-			
-			@Override
-			public boolean accept(File arg0, String arg1) {
-				return arg1.endsWith(".xml");
-			}
-		});
-	}
-	
-	@Override
-	public Properties getProperties(){
-		Properties properties = new Properties();
-		properties.put("isis.persistor", "xml");
-		properties.put("isis.logging.objectstore","on");
-		return properties;
-	}
-	public  String getPropertiesFilename(){
-		return "xml.properties";
-	}
-	@Override
-	public String getSqlTeardownString(){
-		return "SHUTDOWN;";
-	}
-	
-	
-}
-
+public class XmlPersistanceTest extends SqlIntegrationTestCommon {
+
+    public static void deleteFiles(final String directory, final FilenameFilter extension) {
+        final File dir = new File(directory);
+
+        final String[] list = dir.list(extension);
+        File file;
+        if (list.length == 0) {
+            return;
+        }
+
+        for (final String element : list) {
+            file = new File(directory, element);
+            file.delete();
+        }
+    }
+
+    @Override
+    public void initialiseTests() {
+        // Delete all XML files.
+        deleteFiles("xml/objects", new FilenameFilter() {
+
+            @Override
+            public boolean accept(final File arg0, final String arg1) {
+                return arg1.endsWith(".xml");
+            }
+        });
+    }
+
+    @Override
+    public Properties getProperties() {
+        final Properties properties = new Properties();
+        properties.put("isis.persistor", "xml");
+        properties.put("isis.logging.objectstore", "on");
+        return properties;
+    }
+
+    @Override
+    public String getPropertiesFilename() {
+        return "xml.properties";
+    }
+
+    @Override
+    public String getSqlTeardownString() {
+        return "SHUTDOWN;";
+    }
+
+}



Mime
View raw message