Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
c7f45798
Commit
c7f45798
authored
Aug 31, 2017
by
chenith
Committed by
Harsh Shah
Sep 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove invalid columns from company and client.
parent
cbdd2a92
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
55 additions
and
93 deletions
+55
-93
Client.xml
cmsWebApp/sql/Client.xml
+0
-1
Company.xml
cmsWebApp/sql/Company.xml
+0
-1
Client.sql
cmsWebApp/sql/ms/Client.sql
+1
-1
Company.sql
cmsWebApp/sql/ms/Company.sql
+5
-5
Client.sql
cmsWebApp/sql/oracle/Client.sql
+1
-1
Company.sql
cmsWebApp/sql/oracle/Company.sql
+5
-5
Client.sql
cmsWebApp/sql/postgres/Client.sql
+1
-1
Company.sql
cmsWebApp/sql/postgres/Company.sql
+1
-1
BaseCompany.java
cmsWebApp/src/performa/orm/BaseCompany.java
+22
-22
Client.xml
cmsWebApp/src/performa/orm/Client.xml
+1
-1
ClientPersistenceMgr.java
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
+12
-53
Company.xml
cmsWebApp/src/performa/orm/Company.xml
+1
-1
CompanyPersistenceMgr.java
cmsWebApp/src/performa/orm/CompanyPersistenceMgr.java
+0
-0
20170831_AlterCompanyClient.sql
...ensions/performa/upgrades/20170831_AlterCompanyClient.sql
+5
-0
No files found.
cmsWebApp/sql/Client.xml
View file @
c7f45798
...
...
@@ -8,7 +8,6 @@
<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=
"object_type"
type=
"String"
nullable=
"false"
length=
"30"
/>
<column
name=
"company_name"
type=
"String"
nullable=
"false"
length=
"100"
/>
<column
name=
"company_logo"
type=
"BLOB"
nullable=
"true"
/>
<column
name=
"email"
type=
"String"
nullable=
"true"
length=
"100"
/>
...
...
cmsWebApp/sql/Company.xml
View file @
c7f45798
...
...
@@ -8,7 +8,6 @@
<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=
"object_type"
type=
"String"
nullable=
"false"
length=
"30"
/>
<column
name=
"company_name"
type=
"String"
nullable=
"false"
length=
"100"
/>
<column
name=
"hiring_team_type"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"industry"
type=
"String"
nullable=
"true"
length=
"200"
/>
...
...
cmsWebApp/sql/ms/Client.sql
View file @
c7f45798
...
...
@@ -7,7 +7,7 @@ CREATE TABLE tl_client (
object_id
int
NOT
NULL
,
object_last_updated_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_logo
image
NULL
,
email
varchar
(
100
)
NULL
,
...
...
cmsWebApp/sql/ms/Company.sql
View file @
c7f45798
-- DROP TABLE tl_
C
ompany;
-- DROP TABLE tl_
c
ompany;
CREATE
TABLE
tl_
C
ompany
(
CREATE
TABLE
tl_
c
ompany
(
object_id
int
NOT
NULL
,
object_last_updated_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
,
hiring_team_type
varchar
(
200
)
NULL
,
industry
varchar
(
200
)
NULL
,
...
...
@@ -17,8 +17,8 @@ CREATE TABLE tl_Company (
ALTER
TABLE
tl_
C
ompany
ADD
CONSTRAINT
PK_tl_
C
ompany
PRIMARY
KEY
ALTER
TABLE
tl_
c
ompany
ADD
CONSTRAINT
PK_tl_
c
ompany
PRIMARY
KEY
(
object_id
)
;
...
...
cmsWebApp/sql/oracle/Client.sql
View file @
c7f45798
...
...
@@ -8,7 +8,7 @@ CREATE TABLE tl_client (
object_id
number
(
12
)
NOT
NULL
,
object_last_updated_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_logo
blob
NULL
,
email
varchar2
(
100
)
NULL
,
...
...
cmsWebApp/sql/oracle/Company.sql
View file @
c7f45798
-- DROP TABLE tl_
C
ompany;
-- DROP TABLE tl_
c
ompany;
CREATE
TABLE
tl_
C
ompany
(
CREATE
TABLE
tl_
c
ompany
(
object_id
number
(
12
)
NOT
NULL
,
object_last_updated_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
,
hiring_team_type
varchar2
(
200
)
NULL
,
industry
varchar2
(
200
)
NULL
,
...
...
@@ -18,8 +18,8 @@ CREATE TABLE tl_Company (
ALTER
TABLE
tl_
C
ompany
ADD
CONSTRAINT
PK_tl_
C
ompany
PRIMARY
KEY
ALTER
TABLE
tl_
c
ompany
ADD
CONSTRAINT
PK_tl_
c
ompany
PRIMARY
KEY
(
object_id
)
;
...
...
cmsWebApp/sql/postgres/Client.sql
View file @
c7f45798
...
...
@@ -8,7 +8,7 @@ CREATE TABLE tl_client (
object_id
numeric
(
12
)
NOT
NULL
,
object_last_updated_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_logo
bytea
NULL
,
email
varchar
(
100
)
NULL
,
...
...
cmsWebApp/sql/postgres/Company.sql
View file @
c7f45798
...
...
@@ -8,7 +8,7 @@ CREATE TABLE tl_company (
object_id
numeric
(
12
)
NOT
NULL
,
object_last_updated_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
,
hiring_team_type
varchar
(
200
)
NULL
,
industry
varchar
(
200
)
NULL
,
...
...
cmsWebApp/src/performa/orm/BaseCompany.java
View file @
c7f45798
...
...
@@ -285,7 +285,7 @@ public abstract class BaseCompany extends BaseBusinessClass
{
super
.
_initialiseAssociations
();
_AddedByUser
=
new
SingleAssociation
<
Company
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_AddedByUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_
C
ompany"
);
_AddedByUser
=
new
SingleAssociation
<
Company
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_AddedByUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_
c
ompany"
);
_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
);
...
...
@@ -297,7 +297,7 @@ public abstract class BaseCompany extends BaseBusinessClass
{
super
.
initialiseReference
();
_AddedByUser
=
new
SingleAssociation
<
Company
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_AddedByUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_
C
ompany"
);
_AddedByUser
=
new
SingleAssociation
<
Company
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_AddedByUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_
c
ompany"
);
_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
);
...
...
@@ -1293,7 +1293,7 @@ public abstract class BaseCompany extends BaseBusinessClass
public
String
getBaseSetName
()
{
return
"tl_
C
ompany"
;
return
"tl_
c
ompany"
;
}
...
...
@@ -1314,13 +1314,13 @@ public abstract class BaseCompany extends BaseBusinessClass
super
.
getPersistentSets
(
allSets
);
PersistentSet
tl_
CompanyPSet
=
allSets
.
getPersistentSet
(
myID
,
"tl_C
ompany"
,
myPSetStatus
);
PersistentSet
tl_
companyPSet
=
allSets
.
getPersistentSet
(
myID
,
"tl_c
ompany"
,
myPSetStatus
);
tl_
C
ompanyPSet
.
setAttrib
(
FIELD_ObjectID
,
myID
);
tl_
C
ompanyPSet
.
setAttrib
(
FIELD_CompanyName
,
HELPER_CompanyName
.
toObject
(
_CompanyName
));
//
tl_
C
ompanyPSet
.
setAttrib
(
FIELD_HiringTeamType
,
HELPER_HiringTeamType
.
toObject
(
_HiringTeamType
));
//
tl_
C
ompanyPSet
.
setAttrib
(
FIELD_Industry
,
HELPER_Industry
.
toObject
(
_Industry
));
//
tl_
C
ompanyPSet
.
setAttrib
(
FIELD_TimeZone
,
HELPER_TimeZone
.
toObject
(
_TimeZone
));
//
tl_
c
ompanyPSet
.
setAttrib
(
FIELD_ObjectID
,
myID
);
tl_
c
ompanyPSet
.
setAttrib
(
FIELD_CompanyName
,
HELPER_CompanyName
.
toObject
(
_CompanyName
));
//
tl_
c
ompanyPSet
.
setAttrib
(
FIELD_HiringTeamType
,
HELPER_HiringTeamType
.
toObject
(
_HiringTeamType
));
//
tl_
c
ompanyPSet
.
setAttrib
(
FIELD_Industry
,
HELPER_Industry
.
toObject
(
_Industry
));
//
tl_
c
ompanyPSet
.
setAttrib
(
FIELD_TimeZone
,
HELPER_TimeZone
.
toObject
(
_TimeZone
));
//
_AddedByUser
.
getPersistentSets
(
allSets
);
}
...
...
@@ -1334,12 +1334,12 @@ public abstract class BaseCompany extends BaseBusinessClass
super
.
setFromPersistentSets
(
objectID
,
allSets
);
PersistentSet
tl_
CompanyPSet
=
allSets
.
getPersistentSet
(
objectID
,
"tl_C
ompany"
);
PersistentSet
tl_
companyPSet
=
allSets
.
getPersistentSet
(
objectID
,
"tl_c
ompany"
);
_CompanyName
=
(
String
)(
HELPER_CompanyName
.
fromObject
(
_CompanyName
,
tl_
C
ompanyPSet
.
getAttrib
(
FIELD_CompanyName
)));
//
_HiringTeamType
=
(
HiringTeamType
)(
HELPER_HiringTeamType
.
fromObject
(
_HiringTeamType
,
tl_
C
ompanyPSet
.
getAttrib
(
FIELD_HiringTeamType
)));
//
_Industry
=
(
Industry
)(
HELPER_Industry
.
fromObject
(
_Industry
,
tl_
C
ompanyPSet
.
getAttrib
(
FIELD_Industry
)));
//
_TimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
fromObject
(
_TimeZone
,
tl_
C
ompanyPSet
.
getAttrib
(
FIELD_TimeZone
)));
//
_CompanyName
=
(
String
)(
HELPER_CompanyName
.
fromObject
(
_CompanyName
,
tl_
c
ompanyPSet
.
getAttrib
(
FIELD_CompanyName
)));
//
_HiringTeamType
=
(
HiringTeamType
)(
HELPER_HiringTeamType
.
fromObject
(
_HiringTeamType
,
tl_
c
ompanyPSet
.
getAttrib
(
FIELD_HiringTeamType
)));
//
_Industry
=
(
Industry
)(
HELPER_Industry
.
fromObject
(
_Industry
,
tl_
c
ompanyPSet
.
getAttrib
(
FIELD_Industry
)));
//
_TimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
fromObject
(
_TimeZone
,
tl_
c
ompanyPSet
.
getAttrib
(
FIELD_TimeZone
)));
//
_AddedByUser
.
setFromPersistentSets
(
objectID
,
allSets
);
}
...
...
@@ -1633,50 +1633,50 @@ public abstract class BaseCompany extends BaseBusinessClass
public
SearchAll
andObjectID
(
QueryFilter
<
Long
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.object_id"
,
FIELD_ObjectID
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.object_id"
,
FIELD_ObjectID
);
return
this
;
}
public
SearchAll
andObjectCreated
(
QueryFilter
<
Date
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.object_created_date"
,
FIELD_ObjectCreated
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.object_created_date"
,
FIELD_ObjectCreated
);
return
this
;
}
public
SearchAll
andObjectLastModified
(
QueryFilter
<
Date
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.object_last_updated_date"
,
FIELD_ObjectLastModified
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.object_last_updated_date"
,
FIELD_ObjectLastModified
);
return
this
;
}
public
SearchAll
andCompanyName
(
QueryFilter
<
String
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.company_name"
,
"CompanyName"
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.company_name"
,
"CompanyName"
);
return
this
;
}
public
SearchAll
andHiringTeamType
(
QueryFilter
<
HiringTeamType
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.hiring_team_type"
,
"HiringTeamType"
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.hiring_team_type"
,
"HiringTeamType"
);
return
this
;
}
public
SearchAll
andIndustry
(
QueryFilter
<
Industry
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.industry"
,
"Industry"
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.industry"
,
"Industry"
);
return
this
;
}
public
SearchAll
andTimeZone
(
QueryFilter
<
TimeZone
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.time_zone"
,
"TimeZone"
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.time_zone"
,
"TimeZone"
);
return
this
;
}
public
SearchAll
andAddedByUser
(
QueryFilter
<
CompanyUser
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_
C
ompany.added_by_user_id"
,
"AddedByUser"
);
filter
.
addFilter
(
context
,
"tl_
c
ompany.added_by_user_id"
,
"AddedByUser"
);
return
this
;
}
...
...
cmsWebApp/src/performa/orm/Client.xml
View file @
c7f45798
...
...
@@ -7,7 +7,7 @@
<IMPORT
value=
"performa.orm.types.*"
/>
<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=
"CompanyLogo"
type=
"BinaryContent"
dbcol=
"company_logo"
mandatory=
"false"
binaryHandler=
"loggedin"
attribHelper=
"BLOBAttributeHelper"
attribHelperInstance=
"BLOBAttributeHelper.INSTANCE"
/>
...
...
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
View file @
c7f45798
...
...
@@ -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
=
""
;
public
BaseBusinessClass
fetchByID
(
ObjectID
id
,
PersistentSetCollection
allPSets
,
RDBMSPersistenceContext
context
,
SQLManager
sqlMgr
)
throws
SQLException
,
StorageException
...
...
@@ -114,11 +114,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
PersistentSet
tl_clientPSet
=
allPSets
.
getPersistentSet
(
id
,
"tl_client"
,
PersistentSetStatus
.
FETCHED
);
String
objectType
=
null
;
// Check for persistent sets already prefetched
if
(
false
||
!
tl_clientPSet
.
containsAttrib
(
"OBJECT_TYPE"
)
||
!
tl_clientPSet
.
containsAttrib
(
BaseBusinessClass
.
FIELD_ObjectLastModified
)
||
if
(
false
||
!
tl_clientPSet
.
containsAttrib
(
BaseBusinessClass
.
FIELD_ObjectLastModified
)
||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_CompanyName
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_CompanyLogo
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_Email
)||
...
...
@@ -137,22 +136,13 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
LogMgr
.
log
(
ClientPersistence
,
LogLevel
.
DEBUG2
,
"Persistent set preloaded id:"
,
id
);
/* Polymorphic */
objectType
=
(
String
)(
tl_clientPSet
.
getAttrib
(
"OBJECT_TYPE"
)
);
/*
Non
Polymorphic */
Client
result
=
new
Client
(
);
if
(
context
.
getReferenceObject
(
Client
.
REFERENCE_Client
,
objectType
)
!=
Client
.
REFERENCE_Client
)
{
idsToFetch
.
add
(
id
.
longValue
());
}
else
{
Client
result
=
new
Client
();
result
.
setFromPersistentSets
(
id
,
allPSets
);
context
.
addRetrievedObject
(
result
);
result
.
setFromPersistentSets
(
id
,
allPSets
);
context
.
addRetrievedObject
(
result
);
results
.
add
(
result
);
}
results
.
add
(
result
);
}
}
...
...
@@ -316,8 +306,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
LinkedHashMap
<
ObjectID
,
Client
>
results
=
new
LinkedHashMap
();
MultiHashtable
<
String
,
ObjectID
>
needsRefetch
=
new
MultiHashtable
();
ResultSet
r
=
executeQuery
(
sqlMgr
,
query
,
params
);
while
(
r
.
next
())
...
...
@@ -360,17 +348,6 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
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
();
...
...
@@ -378,30 +355,12 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
context
.
addRetrievedObject
(
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
()];
...
...
@@ -505,7 +464,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
tl_clientPSet
.
setAttrib
(
BaseBusinessClass
.
FIELD_ObjectLastModified
,
r
.
getTimestamp
(
"LAST_UPDATED_DATE"
));
// 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_CompanyLogo
,
HELPER_CompanyLogo
.
getFromRS
(
dummyCompanyLogo
,
r
,
"company_logo"
));
...
...
@@ -534,10 +493,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement
(
sqlMgr
,
"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 "
+
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+
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
());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+
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
()).
toList
().
toArray
());
tl_clientPSet
.
setStatus
(
PersistentSetStatus
.
PROCESSED
);
}
...
...
cmsWebApp/src/performa/orm/Company.xml
View file @
c7f45798
...
...
@@ -10,7 +10,7 @@
<MULTIPLEREFERENCE
name=
"Users"
type=
"CompanyUser"
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=
"HiringTeamType"
type=
"HiringTeamType"
dbcol=
"hiring_team_type"
mandatory=
"false"
attribHelper=
"EnumeratedAttributeHelper"
/>
...
...
cmsWebApp/src/performa/orm/CompanyPersistenceMgr.java
View file @
c7f45798
This diff is collapsed.
Click to expand it.
cmsWebApp/webroot/extensions/performa/upgrades/20170831_AlterCompanyClient.sql
0 → 100644
View file @
c7f45798
-- @AutoRun
ALTER
TABLE
tl_company
DROP
COLUMN
object_type
;
ALTER
TABLE
tl_client
DROP
COLUMN
object_type
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment