Commit 82465240 by Nilu

Rename TestAnalysis to TestInput

parent 9189c55a
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">it_does_not_matter</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="xxxx" type="BLOB" nullable="false"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
xxxx image NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
xxxx blob NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
xxxx bytea NOT NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
...@@ -12,7 +12,7 @@ import oneit.servlets.portability.FileDownloader; ...@@ -12,7 +12,7 @@ import oneit.servlets.portability.FileDownloader;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.utils.*; import oneit.utils.*;
import oneit.utils.table.*; import oneit.utils.table.*;
import performa.orm.TestAnalysis; import performa.orm.TestInput;
/** /**
* *
...@@ -25,14 +25,14 @@ public class TestAnalysisFP extends ORMProcessFormProcessor ...@@ -25,14 +25,14 @@ public class TestAnalysisFP extends ORMProcessFormProcessor
@Override @Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{ {
TestAnalysis testAnalysis = (TestAnalysis) process.getAttribute("TestAnalysis"); TestInput testInput = (TestInput) process.getAttribute("TestAnalysis");
ByteArrayOutputStream bos = new ByteArrayOutputStream (); ByteArrayOutputStream bos = new ByteArrayOutputStream ();
byte[] bytes ; byte[] bytes;
//TO-DO -> "filecontent" processing //TO-DO -> "filecontent" processing
try try
{ {
ExcelExporter.ExportAppender excelRenderer = getExportAppender(testAnalysis.getCSV()); ExcelExporter.ExportAppender excelRenderer = getExportAppender(testInput.getCSV());
excelRenderer.export(bos); excelRenderer.export(bos);
bytes = bos.toByteArray(); bytes = bos.toByteArray();
} }
...@@ -79,13 +79,13 @@ public class TestAnalysisFP extends ORMProcessFormProcessor ...@@ -79,13 +79,13 @@ public class TestAnalysisFP extends ORMProcessFormProcessor
{ {
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
TestAnalysis testAnalysis = (TestAnalysis) process.getAttribute("TestAnalysis"); TestInput testAnalysis = (TestInput) process.getAttribute("TestAnalysis");
Debug.assertion(testAnalysis != null, "Test Analysis is null while Processing CSV File."); Debug.assertion(testAnalysis != null, "Test Analysis is null while Processing CSV File.");
if(testAnalysis.getCSV() != null) if(testAnalysis.getCSV() != null)
{ {
BusinessObjectParser.assertFieldCondition(SUPPORTED_TYPES.contains(testAnalysis.getCSV().getContentType()), testAnalysis, TestAnalysis.FIELD_CSV, "invalid", exceptions, true, submission.getRequest()); BusinessObjectParser.assertFieldCondition(SUPPORTED_TYPES.contains(testAnalysis.getCSV().getContentType()), testAnalysis, TestInput.FIELD_CSV, "invalid", exceptions, true, submission.getRequest());
} }
} }
} }
...@@ -29,13 +29,13 @@ import oneit.servlets.orm.*; ...@@ -29,13 +29,13 @@ import oneit.servlets.orm.*;
public abstract class BaseTestAnalysis extends NonPersistentBO public abstract class BaseTestInput extends NonPersistentBO
{ {
// Reference instance for the object // Reference instance for the object
public static final TestAnalysis REFERENCE_TestAnalysis = new TestAnalysis (); public static final TestInput REFERENCE_TestInput = new TestInput ();
// Reference instance for the object // Reference instance for the object
public static final TestAnalysis DUMMY_TestAnalysis = new DummyTestAnalysis (); public static final TestInput DUMMY_TestInput = new DummyTestInput ();
// Static constants corresponding to field names // Static constants corresponding to field names
...@@ -59,14 +59,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -59,14 +59,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
// Map of maps of metadata // Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_TestAnalysis = new HashMap (); private static final Map ATTRIBUTES_METADATA_TestInput = new HashMap ();
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_CSV_Validators; private static final AttributeValidator[] FIELD_CSV_Validators;
// Arrays of behaviour decorators // Arrays of behaviour decorators
private static final TestAnalysisBehaviourDecorator[] TestAnalysis_BehaviourDecorators; private static final TestInputBehaviourDecorator[] TestInput_BehaviourDecorators;
static static
{ {
...@@ -79,9 +79,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -79,9 +79,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
FIELD_CSV_Validators = (AttributeValidator[])setupAttribMetaData_CSV(validatorMapping).toArray (new AttributeValidator[0]); FIELD_CSV_Validators = (AttributeValidator[])setupAttribMetaData_CSV(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_TestAnalysis.initialiseReference (); REFERENCE_TestInput.initialiseReference ();
DUMMY_TestAnalysis.initialiseReference (); DUMMY_TestInput.initialiseReference ();
TestAnalysis_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(TestAnalysis.class).toArray(new TestAnalysisBehaviourDecorator[0]); TestInput_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(TestInput.class).toArray(new TestInputBehaviourDecorator[0]);
} }
catch (RuntimeException e) catch (RuntimeException e)
{ {
...@@ -104,11 +104,11 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -104,11 +104,11 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
metaInfo.put ("name", "CSV"); metaInfo.put ("name", "CSV");
metaInfo.put ("type", "BinaryContent"); metaInfo.put ("type", "BinaryContent");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for TestAnalysis.CSV:", metaInfo); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for TestInput.CSV:", metaInfo);
ATTRIBUTES_METADATA_TestAnalysis.put (FIELD_CSV, Collections.unmodifiableMap (metaInfo)); ATTRIBUTES_METADATA_TestInput.put (FIELD_CSV, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(TestAnalysis.class, "CSV", metaInfo, validatorMapping); List validators = BaseBusinessClass.getAttribValidators(TestInput.class, "CSV", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for TestAnalysis.CSV:", validators); LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for TestInput.CSV:", validators);
return validators; return validators;
} }
...@@ -118,14 +118,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -118,14 +118,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
// This constructor should not be called // This constructor should not be called
protected BaseTestAnalysis () protected BaseTestInput ()
{ {
} }
protected BBCBehaviourDecorator[] getBehaviours() protected BBCBehaviourDecorator[] getBehaviours()
{ {
return TestAnalysis_BehaviourDecorators; return TestInput_BehaviourDecorators;
} }
...@@ -173,9 +173,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -173,9 +173,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
assertValid(); assertValid();
BinaryContent valToReturn = _CSV; BinaryContent valToReturn = _CSV;
for (TestAnalysisBehaviourDecorator bhd : TestAnalysis_BehaviourDecorators) for (TestInputBehaviourDecorator bhd : TestInput_BehaviourDecorators)
{ {
valToReturn = bhd.getCSV ((TestAnalysis)this, valToReturn); valToReturn = bhd.getCSV ((TestInput)this, valToReturn);
} }
return valToReturn; return valToReturn;
...@@ -217,9 +217,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -217,9 +217,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
try try
{ {
for (TestAnalysisBehaviourDecorator bhd : TestAnalysis_BehaviourDecorators) for (TestInputBehaviourDecorator bhd : TestInput_BehaviourDecorators)
{ {
newCSV = bhd.setCSV ((TestAnalysis)this, newCSV); newCSV = bhd.setCSV ((TestInput)this, newCSV);
oldAndNewIdentical = HELPER_CSV.compare (_CSV, newCSV); oldAndNewIdentical = HELPER_CSV.compare (_CSV, newCSV);
} }
...@@ -233,7 +233,7 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -233,7 +233,7 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
if (newCSVObj != null) if (newCSVObj != null)
{ {
int loopMax = FIELD_CSV_Validators.length; int loopMax = FIELD_CSV_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_TestAnalysis.get (FIELD_CSV); Map metadata = (Map)ATTRIBUTES_METADATA_TestInput.get (FIELD_CSV);
for (int v = 0 ; v < loopMax ; ++v) for (int v = 0 ; v < loopMax ; ++v)
{ {
...@@ -472,27 +472,27 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -472,27 +472,27 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
} }
public TestAnalysis newInstance () public TestInput newInstance ()
{ {
return new TestAnalysis (); return new TestInput ();
} }
public TestAnalysis referenceInstance () public TestInput referenceInstance ()
{ {
return REFERENCE_TestAnalysis; return REFERENCE_TestInput;
} }
public TestAnalysis getInTransaction (ObjectTransaction t) throws StorageException public TestInput getInTransaction (ObjectTransaction t) throws StorageException
{ {
return getTestAnalysisByID (t, getObjectID()); return getTestInputByID (t, getObjectID());
} }
public BaseBusinessClass dummyInstance () public BaseBusinessClass dummyInstance ()
{ {
return DUMMY_TestAnalysis; return DUMMY_TestInput;
} }
...@@ -549,13 +549,13 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -549,13 +549,13 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
{ {
super.setAttributesFrom (other, e); super.setAttributesFrom (other, e);
if (other instanceof TestAnalysis) if (other instanceof TestInput)
{ {
TestAnalysis otherTestAnalysis = (TestAnalysis)other; TestInput otherTestInput = (TestInput)other;
try try
{ {
setCSV (otherTestAnalysis.getCSV ()); setCSV (otherTestInput.getCSV ());
} }
catch (FieldException ex) catch (FieldException ex)
{ {
...@@ -573,11 +573,11 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -573,11 +573,11 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
{ {
super.copyAttributesFrom (source); super.copyAttributesFrom (source);
if (source instanceof BaseTestAnalysis) if (source instanceof BaseTestInput)
{ {
BaseTestAnalysis sourceTestAnalysis = (BaseTestAnalysis)(source); BaseTestInput sourceTestInput = (BaseTestInput)(source);
_CSV = sourceTestAnalysis._CSV; _CSV = sourceTestInput._CSV;
} }
} }
...@@ -590,9 +590,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -590,9 +590,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
{ {
super.copySingleAssociationsFrom (source, linkToGhosts); super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseTestAnalysis) if (source instanceof BaseTestInput)
{ {
BaseTestAnalysis sourceTestAnalysis = (BaseTestAnalysis)(source); BaseTestInput sourceTestInput = (BaseTestInput)(source);
} }
...@@ -606,9 +606,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -606,9 +606,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
{ {
super.copyAssociationsFrom (source, linkToGhosts); super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseTestAnalysis) if (source instanceof BaseTestInput)
{ {
BaseTestAnalysis sourceTestAnalysis = (BaseTestAnalysis)(source); BaseTestInput sourceTestInput = (BaseTestInput)(source);
} }
...@@ -651,14 +651,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -651,14 +651,14 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
{ {
super.compare (other, listener); super.compare (other, listener);
if (other instanceof BaseTestAnalysis) if (other instanceof BaseTestInput)
{ {
BaseTestAnalysis otherTestAnalysis = (BaseTestAnalysis)(other); BaseTestInput otherTestInput = (BaseTestInput)(other);
if (!HELPER_CSV.compare(this._CSV, otherTestAnalysis._CSV)) if (!HELPER_CSV.compare(this._CSV, otherTestInput._CSV))
{ {
listener.notifyFieldChange(this, other, FIELD_CSV, HELPER_CSV.toObject(this._CSV), HELPER_CSV.toObject(otherTestAnalysis._CSV)); listener.notifyFieldChange(this, other, FIELD_CSV, HELPER_CSV.toObject(this._CSV), HELPER_CSV.toObject(otherTestInput._CSV));
} }
// Compare single assocs // Compare single assocs
...@@ -695,9 +695,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -695,9 +695,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
} }
public static TestAnalysis createTestAnalysis (ObjectTransaction transaction) throws StorageException public static TestInput createTestInput (ObjectTransaction transaction) throws StorageException
{ {
TestAnalysis result = new TestAnalysis (); TestInput result = new TestInput ();
result.initialiseNewObject (transaction); result.initialiseNewObject (transaction);
...@@ -705,9 +705,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -705,9 +705,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
} }
public static TestAnalysis getTestAnalysisByID (ObjectTransaction transaction, Long objectID) throws StorageException public static TestInput getTestInputByID (ObjectTransaction transaction, Long objectID) throws StorageException
{ {
return (TestAnalysis)(transaction.getObjectByID (REFERENCE_TestAnalysis, objectID)); return (TestInput)(transaction.getObjectByID (REFERENCE_TestInput, objectID));
} }
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
...@@ -829,9 +829,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -829,9 +829,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
public Map getAttributeMetadata (String attribute) public Map getAttributeMetadata (String attribute)
{ {
if (ATTRIBUTES_METADATA_TestAnalysis.containsKey (attribute)) if (ATTRIBUTES_METADATA_TestInput.containsKey (attribute))
{ {
return (Map)ATTRIBUTES_METADATA_TestAnalysis.get (attribute); return (Map)ATTRIBUTES_METADATA_TestInput.get (attribute);
} }
else else
{ {
...@@ -842,9 +842,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -842,9 +842,9 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
public Object getAttributeMetadata (String attribute, String metadata) public Object getAttributeMetadata (String attribute, String metadata)
{ {
if (ATTRIBUTES_METADATA_TestAnalysis.containsKey (attribute)) if (ATTRIBUTES_METADATA_TestInput.containsKey (attribute))
{ {
return ((Map)ATTRIBUTES_METADATA_TestAnalysis.get (attribute)).get(metadata); return ((Map)ATTRIBUTES_METADATA_TestInput.get (attribute)).get(metadata);
} }
else else
{ {
...@@ -887,13 +887,13 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -887,13 +887,13 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
return super.getBinaryContentHandler(attribName); return super.getBinaryContentHandler(attribName);
} }
public static class TestAnalysisBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<TestAnalysis> public static class TestInputBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<TestInput>
{ {
/** /**
* Get the attribute CSV * Get the attribute CSV
*/ */
public BinaryContent getCSV (TestAnalysis obj, BinaryContent original) public BinaryContent getCSV (TestInput obj, BinaryContent original)
{ {
return original; return original;
} }
...@@ -903,7 +903,7 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -903,7 +903,7 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
* May modify the field beforehand * May modify the field beforehand
* Occurs before validation. * Occurs before validation.
*/ */
public BinaryContent setCSV (TestAnalysis obj, BinaryContent newCSV) throws FieldException public BinaryContent setCSV (TestInput obj, BinaryContent newCSV) throws FieldException
{ {
return newCSV; return newCSV;
} }
...@@ -913,46 +913,46 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -913,46 +913,46 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
public ORMPipeLine pipes() public ORMPipeLine pipes()
{ {
return new TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> ((TestAnalysis)this); return new TestInputPipeLineFactory<TestInput, TestInput> ((TestInput)this);
} }
/** /**
* Use this instead of pipes() to get rid of type casting. * Use this instead of pipes() to get rid of type casting.
*/ */
public TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> pipelineTestAnalysis() public TestInputPipeLineFactory<TestInput, TestInput> pipelineTestInput()
{ {
return (TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis>) pipes(); return (TestInputPipeLineFactory<TestInput, TestInput>) pipes();
} }
public static TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> pipesTestAnalysis(Collection<TestAnalysis> items) public static TestInputPipeLineFactory<TestInput, TestInput> pipesTestInput(Collection<TestInput> items)
{ {
return REFERENCE_TestAnalysis.new TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> (items); return REFERENCE_TestInput.new TestInputPipeLineFactory<TestInput, TestInput> (items);
} }
public static TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> pipesTestAnalysis(TestAnalysis[] _items) public static TestInputPipeLineFactory<TestInput, TestInput> pipesTestInput(TestInput[] _items)
{ {
return pipesTestAnalysis(Arrays.asList (_items)); return pipesTestInput(Arrays.asList (_items));
} }
public static TestAnalysisPipeLineFactory<TestAnalysis, TestAnalysis> pipesTestAnalysis() public static TestInputPipeLineFactory<TestInput, TestInput> pipesTestInput()
{ {
return pipesTestAnalysis((Collection)null); return pipesTestInput((Collection)null);
} }
public class TestAnalysisPipeLineFactory<From extends BaseBusinessClass, Me extends TestAnalysis> extends NonPersistentBOPipeLineFactory<From, Me> public class TestInputPipeLineFactory<From extends BaseBusinessClass, Me extends TestInput> extends NonPersistentBOPipeLineFactory<From, Me>
{ {
public <Prev> TestAnalysisPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe) public <Prev> TestInputPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{ {
super (pipeLine, nextPipe); super (pipeLine, nextPipe);
} }
public TestAnalysisPipeLineFactory (From seed) public TestInputPipeLineFactory (From seed)
{ {
super(seed); super(seed);
} }
public TestAnalysisPipeLineFactory (Collection<From> seed) public TestInputPipeLineFactory (Collection<From> seed)
{ {
super(seed); super(seed);
} }
...@@ -989,10 +989,10 @@ public abstract class BaseTestAnalysis extends NonPersistentBO ...@@ -989,10 +989,10 @@ public abstract class BaseTestAnalysis extends NonPersistentBO
} }
} }
class DummyTestAnalysis extends TestAnalysis class DummyTestInput extends TestInput
{ {
// Default constructor primarily to support Externalisable // Default constructor primarily to support Externalisable
public DummyTestAnalysis() public DummyTestInput()
{ {
super(); super();
} }
......
package performa.orm; package performa.orm;
public class TestAnalysis extends BaseTestAnalysis public class TestInput extends BaseTestInput
{ {
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
// This constructor should not be called // This constructor should not be called
public TestAnalysis () public TestInput ()
{ {
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ROOT> <ROOT>
<BUSINESSCLASS name="TestAnalysis" package="performa.orm" superclass="NonPersistentBO"> <BUSINESSCLASS name="TestInput" package="performa.orm" superclass="NonPersistentBO">
<IMPORT value="oneit.servlets.orm.*"/> <IMPORT value="oneit.servlets.orm.*"/>
......
...@@ -22,9 +22,9 @@ import oneit.servlets.orm.*; ...@@ -22,9 +22,9 @@ import oneit.servlets.orm.*;
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!! * IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl] * Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/ */
public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr public class TestInputPersistenceMgr extends NonPersistentBOPersistenceMgr
{ {
private static final LoggingArea TestAnalysisPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "TestAnalysis"); private static final LoggingArea TestInputPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "TestInput");
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private BinaryContent dummyCSV; private BinaryContent dummyCSV;
...@@ -36,7 +36,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -36,7 +36,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
public TestAnalysisPersistenceMgr () public TestInputPersistenceMgr ()
{ {
dummyCSV = (BinaryContent)(HELPER_CSV.initialise (dummyCSV)); dummyCSV = (BinaryContent)(HELPER_CSV.initialise (dummyCSV));
...@@ -74,16 +74,16 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -74,16 +74,16 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
{ {
if (context.containsObject(id)) // Check for cached version if (context.containsObject(id)) // Check for cached version
{ {
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, TestAnalysis.REFERENCE_TestAnalysis); BaseBusinessClass objectToReturn = context.getObjectToReplace(id, TestInput.REFERENCE_TestInput);
if (objectToReturn instanceof TestAnalysis) if (objectToReturn instanceof TestInput)
{ {
LogMgr.log (TestAnalysisPersistence, LogLevel.TRACE, "Cache hit for id:", id); LogMgr.log (TestInputPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn); results.add (objectToReturn);
} }
else else
{ {
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a TestAnalysis"); throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a TestInput");
} }
} }
...@@ -93,17 +93,17 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -93,17 +93,17 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(TestAnalysis.FIELD_CSV)) !it_does_not_matterPSet.containsAttrib(TestInput.FIELD_CSV))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
} }
else else
{ {
LogMgr.log (TestAnalysisPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id); LogMgr.log (TestInputPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */ /* Non Polymorphic */
TestAnalysis result = new TestAnalysis (); TestInput result = new TestInput ();
result.setFromPersistentSets(id, allPSets); result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result); context.addRetrievedObject(result);
...@@ -166,7 +166,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -166,7 +166,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
"SET xxxx = ? , OBJECT_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET xxxx = ? , OBJECT_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.OBJECT_id = ? AND " + getConcurrencyCheck (sqlMgr, "OBJECT_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE it_does_not_matter.OBJECT_id = ? AND " + getConcurrencyCheck (sqlMgr, "OBJECT_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CSV.getForSQL(dummyCSV, it_does_not_matterPSet.getAttrib (TestAnalysis.FIELD_CSV))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_CSV.getForSQL(dummyCSV, it_does_not_matterPSet.getAttrib (TestInput.FIELD_CSV))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -182,14 +182,14 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -182,14 +182,14 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
new Object[] { "it_does_not_matter", objectID.longID (), obj.getObjectLastModified (), d }, new Object[] { "it_does_not_matter", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ()); sqlMgr.getPortabilityServices ());
LogMgr.log (TestAnalysisPersistence, LogLevel.BUSINESS1, errorMsg); LogMgr.log (TestInputPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter"); throw new ConcurrentUpdateConflictException (obj, "it_does_not_matter");
} }
else else
{ {
String errorMsg = "Attempt to update nonexistent row in table:it_does_not_matter for row:" + objectID + " objDate:" + obj.getObjectLastModified (); String errorMsg = "Attempt to update nonexistent row in table:it_does_not_matter for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (TestAnalysisPersistence, LogLevel.BUSINESS1, errorMsg); LogMgr.log (TestInputPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg); throw new RuntimeException (errorMsg);
} }
} }
...@@ -200,7 +200,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -200,7 +200,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
} }
else else
{ {
LogMgr.log (TestAnalysisPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID); LogMgr.log (TestInputPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
} }
} }
...@@ -212,7 +212,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -212,7 +212,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter"); PersistentSet it_does_not_matterPSet = allPSets.getPersistentSet(objectID, "it_does_not_matter");
LogMgr.log (TestAnalysisPersistence, LogLevel.DEBUG2, "Deleting:", objectID); LogMgr.log (TestInputPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED && if (it_does_not_matterPSet.getStatus () != PersistentSetStatus.PROCESSED &&
...@@ -239,7 +239,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -239,7 +239,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
{ {
String errorMsg = "Attempt to delete nonexistent row in table:it_does_not_matter for row:" + objectID; String errorMsg = "Attempt to delete nonexistent row in table:it_does_not_matter for row:" + objectID;
LogMgr.log (TestAnalysisPersistence, LogLevel.SYSTEMERROR1, errorMsg); LogMgr.log (TestInputPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg); throw new RuntimeException (errorMsg);
} }
} }
...@@ -256,7 +256,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -256,7 +256,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{ {
LinkedHashMap<ObjectID, TestAnalysis> results = new LinkedHashMap (); LinkedHashMap<ObjectID, TestInput> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params); ResultSet r = executeQuery (sqlMgr, query, params);
...@@ -264,8 +264,8 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -264,8 +264,8 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
{ {
ThreadUtils.checkInterrupted (); ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (TestAnalysis.REFERENCE_TestAnalysis.getObjectIDSpace (), r.getLong ("id")); ObjectID objectID = new ObjectID (TestInput.REFERENCE_TestInput.getObjectIDSpace (), r.getLong ("id"));
TestAnalysis resultElement; TestInput resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows) if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{ {
...@@ -281,16 +281,16 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -281,16 +281,16 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
if (context.containsObject(objectID)) if (context.containsObject(objectID))
{ {
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, TestAnalysis.REFERENCE_TestAnalysis); BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, TestInput.REFERENCE_TestInput);
if (cachedElement instanceof TestAnalysis) if (cachedElement instanceof TestInput)
{ {
LogMgr.log (TestAnalysisPersistence, LogLevel.TRACE, "Cache hit for id:", objectID); LogMgr.log (TestInputPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (TestAnalysis)cachedElement; resultElement = (TestInput)cachedElement;
} }
else else
{ {
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a TestAnalysis"); throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a TestInput");
} }
} }
else else
...@@ -301,7 +301,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -301,7 +301,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
resultElement = new TestAnalysis (); resultElement = new TestInput ();
resultElement.setFromPersistentSets(objectID, allPSets); resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement); context.addRetrievedObject(resultElement);
...@@ -323,7 +323,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -323,7 +323,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{ {
LogMgr.log (TestAnalysisPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria); LogMgr.log (TestInputPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter); String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy); String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables); String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
...@@ -370,7 +370,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -370,7 +370,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
for (int x = 0 ; x < resultsArray.length ; ++x) for (int x = 0 ; x < resultsArray.length ; ++x)
{ {
if (resultsArray[x] instanceof TestAnalysis) if (resultsArray[x] instanceof TestInput)
{ {
results.add (resultsArray[x]); results.add (resultsArray[x]);
} }
...@@ -400,7 +400,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -400,7 +400,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
// Object Created // Object Created
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE")); it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(TestAnalysis.FIELD_CSV, HELPER_CSV.getFromRS(dummyCSV, r, "xxxx")); it_does_not_matterPSet.setAttrib(TestInput.FIELD_CSV, HELPER_CSV.getFromRS(dummyCSV, r, "xxxx"));
} }
...@@ -421,7 +421,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr ...@@ -421,7 +421,7 @@ public class TestAnalysisPersistenceMgr extends NonPersistentBOPersistenceMgr
" (xxxx, OBJECT_id, OBJECT_LAST_UPDATED_DATE, OBJECT_CREATED_DATE) " + " (xxxx, OBJECT_id, OBJECT_LAST_UPDATED_DATE, OBJECT_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CSV.getForSQL(dummyCSV, it_does_not_matterPSet.getAttrib (TestAnalysis.FIELD_CSV))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_CSV.getForSQL(dummyCSV, it_does_not_matterPSet.getAttrib (TestInput.FIELD_CSV))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED); it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment