Commit c7f45798 by chenith Committed by Harsh Shah

Remove invalid columns from company and client.

parent cbdd2a92
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <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_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="object_type" type="String" nullable="false" length="30"/>
<column name="company_name" type="String" nullable="false" length="100"/> <column name="company_name" type="String" nullable="false" length="100"/>
<column name="company_logo" type="BLOB" nullable="true"/> <column name="company_logo" type="BLOB" nullable="true"/>
<column name="email" type="String" nullable="true" length="100"/> <column name="email" type="String" nullable="true" length="100"/>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<column name="object_id" type="Long" nullable="false" length="11"/> <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_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="object_type" type="String" nullable="false" length="30"/>
<column name="company_name" type="String" nullable="false" length="100"/> <column name="company_name" type="String" nullable="false" length="100"/>
<column name="hiring_team_type" type="String" nullable="true" length="200"/> <column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/> <column name="industry" type="String" nullable="true" length="200"/>
......
...@@ -7,7 +7,7 @@ CREATE TABLE tl_client ( ...@@ -7,7 +7,7 @@ CREATE TABLE tl_client (
object_id int NOT NULL , object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL , ,
company_name varchar(100) NOT NULL, company_name varchar(100) NOT NULL,
company_logo image NULL, company_logo image NULL,
email varchar(100) NULL, email varchar(100) NULL,
......
-- DROP TABLE tl_Company; -- DROP TABLE tl_company;
CREATE TABLE tl_Company ( CREATE TABLE tl_company (
object_id int NOT NULL , object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL , object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL , ,
company_name varchar(100) NOT NULL, company_name varchar(100) NOT NULL,
hiring_team_type varchar(200) NULL, hiring_team_type varchar(200) NULL,
industry varchar(200) NULL, industry varchar(200) NULL,
...@@ -17,8 +17,8 @@ CREATE TABLE tl_Company ( ...@@ -17,8 +17,8 @@ CREATE TABLE tl_Company (
ALTER TABLE tl_Company ADD ALTER TABLE tl_company ADD
CONSTRAINT PK_tl_Company PRIMARY KEY CONSTRAINT PK_tl_company PRIMARY KEY
( (
object_id object_id
) ; ) ;
......
...@@ -8,7 +8,7 @@ CREATE TABLE tl_client ( ...@@ -8,7 +8,7 @@ CREATE TABLE tl_client (
object_id number(12) NOT NULL , object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL , ,
company_name varchar2(100) NOT NULL, company_name varchar2(100) NOT NULL,
company_logo blob NULL, company_logo blob NULL,
email varchar2(100) NULL, email varchar2(100) NULL,
......
-- DROP TABLE tl_Company; -- DROP TABLE tl_company;
CREATE TABLE tl_Company ( CREATE TABLE tl_company (
object_id number(12) NOT NULL , object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL , object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL , ,
company_name varchar2(100) NOT NULL, company_name varchar2(100) NOT NULL,
hiring_team_type varchar2(200) NULL, hiring_team_type varchar2(200) NULL,
industry varchar2(200) NULL, industry varchar2(200) NULL,
...@@ -18,8 +18,8 @@ CREATE TABLE tl_Company ( ...@@ -18,8 +18,8 @@ CREATE TABLE tl_Company (
ALTER TABLE tl_Company ADD ALTER TABLE tl_company ADD
CONSTRAINT PK_tl_Company PRIMARY KEY CONSTRAINT PK_tl_company PRIMARY KEY
( (
object_id object_id
) ; ) ;
......
...@@ -8,7 +8,7 @@ CREATE TABLE tl_client ( ...@@ -8,7 +8,7 @@ CREATE TABLE tl_client (
object_id numeric(12) NOT NULL , object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL , ,
company_name varchar(100) NOT NULL, company_name varchar(100) NOT NULL,
company_logo bytea NULL, company_logo bytea NULL,
email varchar(100) NULL, email varchar(100) NULL,
......
...@@ -8,7 +8,7 @@ CREATE TABLE tl_company ( ...@@ -8,7 +8,7 @@ CREATE TABLE tl_company (
object_id numeric(12) NOT NULL , object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL , object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL , ,
company_name varchar(100) NOT NULL, company_name varchar(100) NOT NULL,
hiring_team_type varchar(200) NULL, hiring_team_type varchar(200) NULL,
industry varchar(200) NULL, industry varchar(200) NULL,
......
...@@ -285,7 +285,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -285,7 +285,7 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
super._initialiseAssociations (); super._initialiseAssociations ();
_AddedByUser = new SingleAssociation<Company, CompanyUser> (this, SINGLEREFERENCE_AddedByUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_Company"); _AddedByUser = new SingleAssociation<Company, CompanyUser> (this, SINGLEREFERENCE_AddedByUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_company");
_Users = new MultipleAssociation<Company, CompanyUser> (this, MULTIPLEREFERENCE_Users, CompanyUser.SINGLEREFERENCE_Company, CompanyUser.REFERENCE_CompanyUser); _Users = new MultipleAssociation<Company, CompanyUser> (this, MULTIPLEREFERENCE_Users, CompanyUser.SINGLEREFERENCE_Company, CompanyUser.REFERENCE_CompanyUser);
_Clients = new MultipleAssociation<Company, Client> (this, MULTIPLEREFERENCE_Clients, Client.SINGLEREFERENCE_Company, Client.REFERENCE_Client); _Clients = new MultipleAssociation<Company, Client> (this, MULTIPLEREFERENCE_Clients, Client.SINGLEREFERENCE_Company, Client.REFERENCE_Client);
...@@ -297,7 +297,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -297,7 +297,7 @@ public abstract class BaseCompany extends BaseBusinessClass
{ {
super.initialiseReference (); super.initialiseReference ();
_AddedByUser = new SingleAssociation<Company, CompanyUser> (this, SINGLEREFERENCE_AddedByUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_Company"); _AddedByUser = new SingleAssociation<Company, CompanyUser> (this, SINGLEREFERENCE_AddedByUser, null, CompanyUser.REFERENCE_CompanyUser, "tl_company");
_Users = new MultipleAssociation<Company, CompanyUser> (this, MULTIPLEREFERENCE_Users, CompanyUser.SINGLEREFERENCE_Company, CompanyUser.REFERENCE_CompanyUser); _Users = new MultipleAssociation<Company, CompanyUser> (this, MULTIPLEREFERENCE_Users, CompanyUser.SINGLEREFERENCE_Company, CompanyUser.REFERENCE_CompanyUser);
_Clients = new MultipleAssociation<Company, Client> (this, MULTIPLEREFERENCE_Clients, Client.SINGLEREFERENCE_Company, Client.REFERENCE_Client); _Clients = new MultipleAssociation<Company, Client> (this, MULTIPLEREFERENCE_Clients, Client.SINGLEREFERENCE_Company, Client.REFERENCE_Client);
...@@ -1293,7 +1293,7 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1293,7 +1293,7 @@ public abstract class BaseCompany extends BaseBusinessClass
public String getBaseSetName () public String getBaseSetName ()
{ {
return "tl_Company"; return "tl_company";
} }
...@@ -1314,13 +1314,13 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1314,13 +1314,13 @@ public abstract class BaseCompany extends BaseBusinessClass
super.getPersistentSets (allSets); super.getPersistentSets (allSets);
PersistentSet tl_CompanyPSet = allSets.getPersistentSet (myID, "tl_Company", myPSetStatus); PersistentSet tl_companyPSet = allSets.getPersistentSet (myID, "tl_company", myPSetStatus);
tl_CompanyPSet.setAttrib (FIELD_ObjectID, myID); tl_companyPSet.setAttrib (FIELD_ObjectID, myID);
tl_CompanyPSet.setAttrib (FIELD_CompanyName, HELPER_CompanyName.toObject (_CompanyName)); // tl_companyPSet.setAttrib (FIELD_CompanyName, HELPER_CompanyName.toObject (_CompanyName)); //
tl_CompanyPSet.setAttrib (FIELD_HiringTeamType, HELPER_HiringTeamType.toObject (_HiringTeamType)); // tl_companyPSet.setAttrib (FIELD_HiringTeamType, HELPER_HiringTeamType.toObject (_HiringTeamType)); //
tl_CompanyPSet.setAttrib (FIELD_Industry, HELPER_Industry.toObject (_Industry)); // tl_companyPSet.setAttrib (FIELD_Industry, HELPER_Industry.toObject (_Industry)); //
tl_CompanyPSet.setAttrib (FIELD_TimeZone, HELPER_TimeZone.toObject (_TimeZone)); // tl_companyPSet.setAttrib (FIELD_TimeZone, HELPER_TimeZone.toObject (_TimeZone)); //
_AddedByUser.getPersistentSets (allSets); _AddedByUser.getPersistentSets (allSets);
} }
...@@ -1334,12 +1334,12 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1334,12 +1334,12 @@ public abstract class BaseCompany extends BaseBusinessClass
super.setFromPersistentSets (objectID, allSets); super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_CompanyPSet = allSets.getPersistentSet (objectID, "tl_Company"); PersistentSet tl_companyPSet = allSets.getPersistentSet (objectID, "tl_company");
_CompanyName = (String)(HELPER_CompanyName.fromObject (_CompanyName, tl_CompanyPSet.getAttrib (FIELD_CompanyName))); // _CompanyName = (String)(HELPER_CompanyName.fromObject (_CompanyName, tl_companyPSet.getAttrib (FIELD_CompanyName))); //
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.fromObject (_HiringTeamType, tl_CompanyPSet.getAttrib (FIELD_HiringTeamType))); // _HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.fromObject (_HiringTeamType, tl_companyPSet.getAttrib (FIELD_HiringTeamType))); //
_Industry = (Industry)(HELPER_Industry.fromObject (_Industry, tl_CompanyPSet.getAttrib (FIELD_Industry))); // _Industry = (Industry)(HELPER_Industry.fromObject (_Industry, tl_companyPSet.getAttrib (FIELD_Industry))); //
_TimeZone = (TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, tl_CompanyPSet.getAttrib (FIELD_TimeZone))); // _TimeZone = (TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, tl_companyPSet.getAttrib (FIELD_TimeZone))); //
_AddedByUser.setFromPersistentSets (objectID, allSets); _AddedByUser.setFromPersistentSets (objectID, allSets);
} }
...@@ -1633,50 +1633,50 @@ public abstract class BaseCompany extends BaseBusinessClass ...@@ -1633,50 +1633,50 @@ public abstract class BaseCompany extends BaseBusinessClass
public SearchAll andObjectID (QueryFilter<Long> filter) public SearchAll andObjectID (QueryFilter<Long> filter)
{ {
filter.addFilter (context, "tl_Company.object_id", FIELD_ObjectID); filter.addFilter (context, "tl_company.object_id", FIELD_ObjectID);
return this; return this;
} }
public SearchAll andObjectCreated (QueryFilter<Date> filter) public SearchAll andObjectCreated (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "tl_Company.object_created_date", FIELD_ObjectCreated); filter.addFilter (context, "tl_company.object_created_date", FIELD_ObjectCreated);
return this; return this;
} }
public SearchAll andObjectLastModified (QueryFilter<Date> filter) public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "tl_Company.object_last_updated_date", FIELD_ObjectLastModified); filter.addFilter (context, "tl_company.object_last_updated_date", FIELD_ObjectLastModified);
return this; return this;
} }
public SearchAll andCompanyName (QueryFilter<String> filter) public SearchAll andCompanyName (QueryFilter<String> filter)
{ {
filter.addFilter (context, "tl_Company.company_name", "CompanyName"); filter.addFilter (context, "tl_company.company_name", "CompanyName");
return this; return this;
} }
public SearchAll andHiringTeamType (QueryFilter<HiringTeamType> filter) public SearchAll andHiringTeamType (QueryFilter<HiringTeamType> filter)
{ {
filter.addFilter (context, "tl_Company.hiring_team_type", "HiringTeamType"); filter.addFilter (context, "tl_company.hiring_team_type", "HiringTeamType");
return this; return this;
} }
public SearchAll andIndustry (QueryFilter<Industry> filter) public SearchAll andIndustry (QueryFilter<Industry> filter)
{ {
filter.addFilter (context, "tl_Company.industry", "Industry"); filter.addFilter (context, "tl_company.industry", "Industry");
return this; return this;
} }
public SearchAll andTimeZone (QueryFilter<TimeZone> filter) public SearchAll andTimeZone (QueryFilter<TimeZone> filter)
{ {
filter.addFilter (context, "tl_Company.time_zone", "TimeZone"); filter.addFilter (context, "tl_company.time_zone", "TimeZone");
return this; return this;
} }
public SearchAll andAddedByUser (QueryFilter<CompanyUser> filter) public SearchAll andAddedByUser (QueryFilter<CompanyUser> filter)
{ {
filter.addFilter (context, "tl_Company.added_by_user_id", "AddedByUser"); filter.addFilter (context, "tl_company.added_by_user_id", "AddedByUser");
return this; return this;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<IMPORT value="oneit.business.shopping.orm.*"/> <IMPORT value="oneit.business.shopping.orm.*"/>
<TABLE name="tl_client" tablePrefix="object" polymorphic="TRUE"> <TABLE name="tl_client" tablePrefix="object">
<ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100"/> <ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100"/>
<ATTRIB name="CompanyLogo" type="BinaryContent" dbcol="company_logo" mandatory="false" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" /> <ATTRIB name="CompanyLogo" type="BinaryContent" dbcol="company_logo" mandatory="false" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
......
...@@ -67,7 +67,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -67,7 +67,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
} }
private String SELECT_COLUMNS = "{PREFIX}tl_client.object_id as id, {PREFIX}tl_client.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_client.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_client.object_TYPE as OBJECT_TYPE, {PREFIX}tl_client.company_name, {PREFIX}tl_client.company_logo, {PREFIX}tl_client.email, {PREFIX}tl_client.contact_name, {PREFIX}tl_client.contact_surname, {PREFIX}tl_client.phone, {PREFIX}tl_client.state, {PREFIX}tl_client.country, {PREFIX}tl_client.post_code, {PREFIX}tl_client.company_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_client.object_id as id, {PREFIX}tl_client.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_client.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_client.company_name, {PREFIX}tl_client.company_logo, {PREFIX}tl_client.email, {PREFIX}tl_client.contact_name, {PREFIX}tl_client.contact_surname, {PREFIX}tl_client.phone, {PREFIX}tl_client.state, {PREFIX}tl_client.country, {PREFIX}tl_client.post_code, {PREFIX}tl_client.company_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -114,11 +114,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -114,11 +114,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
PersistentSet tl_clientPSet = allPSets.getPersistentSet(id, "tl_client", PersistentSetStatus.FETCHED); PersistentSet tl_clientPSet = allPSets.getPersistentSet(id, "tl_client", PersistentSetStatus.FETCHED);
String objectType = null;
// Check for persistent sets already prefetched // Check for persistent sets already prefetched
if (false || if (false || !tl_clientPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_clientPSet.containsAttrib("OBJECT_TYPE") || !tl_clientPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_clientPSet.containsAttrib(Client.FIELD_CompanyName)|| !tl_clientPSet.containsAttrib(Client.FIELD_CompanyName)||
!tl_clientPSet.containsAttrib(Client.FIELD_CompanyLogo)|| !tl_clientPSet.containsAttrib(Client.FIELD_CompanyLogo)||
!tl_clientPSet.containsAttrib(Client.FIELD_Email)|| !tl_clientPSet.containsAttrib(Client.FIELD_Email)||
...@@ -137,22 +136,13 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -137,22 +136,13 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{ {
LogMgr.log (ClientPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id); LogMgr.log (ClientPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Polymorphic */ /* Non Polymorphic */
objectType = (String)(tl_clientPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (Client.REFERENCE_Client, objectType) != Client.REFERENCE_Client)
{
idsToFetch.add (id.longValue());
}
else
{
Client result = new Client (); Client result = new Client ();
result.setFromPersistentSets(id, allPSets); result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result); context.addRetrievedObject(result);
results.add (result); results.add (result);
}
} }
} }
...@@ -316,8 +306,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -316,8 +306,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{ {
LinkedHashMap<ObjectID, Client> results = new LinkedHashMap (); LinkedHashMap<ObjectID, Client> results = new LinkedHashMap ();
MultiHashtable<String,ObjectID> needsRefetch = new MultiHashtable ();
ResultSet r = executeQuery (sqlMgr, query, params); ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next()) while (r.next())
...@@ -360,17 +348,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -360,17 +348,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
createPersistentSetFromRS(allPSets, r, objectID); createPersistentSetFromRS(allPSets, r, objectID);
String objectType = (String)(tl_clientPSet.getAttrib("OBJECT_TYPE"));
if (context.getReferenceObject (Client.REFERENCE_Client, objectType) != Client.REFERENCE_Client)
{
needsRefetch.add (objectType, objectID); // We will fetch these later
resultElement = new Client ();
resultElement.initialiseGhost (objectID);
}
else
{
resultElement = new Client (); resultElement = new Client ();
...@@ -380,28 +357,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -380,28 +357,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
} }
}
results.put (objectID, resultElement); results.put (objectID, resultElement);
} }
for (String objectType : needsRefetch.keySet())
{
BaseBusinessClass referenceObject = context.getReferenceObject (Client.REFERENCE_Client, objectType);
ObjectPersistenceMgr persistenceMgr = context.getPersistenceMgr (referenceObject);
ResourceCheckpoint checkpoint = sqlMgr.getCheckpoint();
Set<BaseBusinessClass> objsRefetched = persistenceMgr.fetchByIDs(new HashSet (needsRefetch.getValuesForKey (objectType)), allPSets, context, sqlMgr);
checkpoint.releaseNewResources();
for (BaseBusinessClass objRefetched : objsRefetched)
{
results.put (objRefetched.getID (), (Client)objRefetched);
}
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()]; BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
...@@ -505,7 +464,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -505,7 +464,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE")); tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created // Object Created
tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));tl_clientPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE")); tl_clientPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_clientPSet.setAttrib(Client.FIELD_CompanyName, HELPER_CompanyName.getFromRS(dummyCompanyName, r, "company_name")); tl_clientPSet.setAttrib(Client.FIELD_CompanyName, HELPER_CompanyName.getFromRS(dummyCompanyName, r, "company_name"));
tl_clientPSet.setAttrib(Client.FIELD_CompanyLogo, HELPER_CompanyLogo.getFromRS(dummyCompanyLogo, r, "company_logo")); tl_clientPSet.setAttrib(Client.FIELD_CompanyLogo, HELPER_CompanyLogo.getFromRS(dummyCompanyLogo, r, "company_logo"));
...@@ -534,10 +493,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr ...@@ -534,10 +493,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_client " + "INSERT INTO {PREFIX}tl_client " +
" (company_name, company_logo, email, contact_name, contact_surname, phone, state, country, post_code, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " + " (company_name, company_logo, email, contact_name, contact_surname, phone, state, country, post_code, company_id, 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_CompanyName.getForSQL(dummyCompanyName, tl_clientPSet.getAttrib (Client.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_clientPSet.getAttrib (Client.FIELD_CompanyLogo))).listEntry (HELPER_Email.getForSQL(dummyEmail, tl_clientPSet.getAttrib (Client.FIELD_Email))).listEntry (HELPER_ContactName.getForSQL(dummyContactName, tl_clientPSet.getAttrib (Client.FIELD_ContactName))).listEntry (HELPER_ContactSurname.getForSQL(dummyContactSurname, tl_clientPSet.getAttrib (Client.FIELD_ContactSurname))).listEntry (HELPER_Phone.getForSQL(dummyPhone, tl_clientPSet.getAttrib (Client.FIELD_Phone))).listEntry (HELPER_State.getForSQL(dummyState, tl_clientPSet.getAttrib (Client.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_clientPSet.getAttrib (Client.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_clientPSet.getAttrib (Client.FIELD_PostCode))) .listEntry (SQLManager.CheckNull((Long)(tl_clientPSet.getAttrib (Client.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray()); CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_clientPSet.getAttrib (Client.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_clientPSet.getAttrib (Client.FIELD_CompanyLogo))).listEntry (HELPER_Email.getForSQL(dummyEmail, tl_clientPSet.getAttrib (Client.FIELD_Email))).listEntry (HELPER_ContactName.getForSQL(dummyContactName, tl_clientPSet.getAttrib (Client.FIELD_ContactName))).listEntry (HELPER_ContactSurname.getForSQL(dummyContactSurname, tl_clientPSet.getAttrib (Client.FIELD_ContactSurname))).listEntry (HELPER_Phone.getForSQL(dummyPhone, tl_clientPSet.getAttrib (Client.FIELD_Phone))).listEntry (HELPER_State.getForSQL(dummyState, tl_clientPSet.getAttrib (Client.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_clientPSet.getAttrib (Client.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_clientPSet.getAttrib (Client.FIELD_PostCode))) .listEntry (SQLManager.CheckNull((Long)(tl_clientPSet.getAttrib (Client.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).toList().toArray());
tl_clientPSet.setStatus (PersistentSetStatus.PROCESSED); tl_clientPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/> <MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/>
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/> <MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/>
<TABLE name="tl_Company" tablePrefix="object" polymorphic="TRUE"> <TABLE name="tl_company" tablePrefix="object">
<ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100" /> <ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100" />
<ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
......
-- @AutoRun
ALTER TABLE tl_company DROP COLUMN object_type;
ALTER TABLE tl_client DROP COLUMN object_type;
\ No newline at end of file
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