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
84725807
Commit
84725807
authored
Sep 01, 2017
by
chenith
Committed by
Harsh Shah
Sep 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated client column names.
parent
dfe98ab4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
172 additions
and
167 deletions
+172
-167
Client.xml
cmsWebApp/sql/Client.xml
+2
-2
Client.sql
cmsWebApp/sql/ms/Client.sql
+2
-2
Client.sql
cmsWebApp/sql/oracle/Client.sql
+2
-2
Client.sql
cmsWebApp/sql/postgres/Client.sql
+2
-2
BaseClient.java
cmsWebApp/src/performa/orm/BaseClient.java
+142
-142
Client.xml
cmsWebApp/src/performa/orm/Client.xml
+2
-2
ClientPersistenceMgr.java
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
+15
-15
20170901_Alter_Client.sql
...ot/extensions/performa/upgrades/20170901_Alter_Client.sql
+5
-0
No files found.
cmsWebApp/sql/Client.xml
View file @
84725807
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
<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=
"c
ompany
_name"
type=
"String"
nullable=
"false"
length=
"100"
/>
<column
name=
"c
lient
_name"
type=
"String"
nullable=
"false"
length=
"100"
/>
<column
name=
"c
ompany
_logo"
type=
"BLOB"
nullable=
"true"
/>
<column
name=
"c
lient
_logo"
type=
"BLOB"
nullable=
"true"
/>
<column
name=
"email"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"email"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"contact_name"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"contact_name"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"contact_surname"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"contact_surname"
type=
"String"
nullable=
"true"
length=
"100"
/>
...
...
cmsWebApp/sql/ms/Client.sql
View file @
84725807
...
@@ -8,8 +8,8 @@ CREATE TABLE tl_client (
...
@@ -8,8 +8,8 @@ CREATE TABLE tl_client (
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
,
,
c
ompany
_name
varchar
(
100
)
NOT
NULL
,
c
lient
_name
varchar
(
100
)
NOT
NULL
,
c
ompany
_logo
image
NULL
,
c
lient
_logo
image
NULL
,
email
varchar
(
100
)
NULL
,
email
varchar
(
100
)
NULL
,
contact_name
varchar
(
100
)
NULL
,
contact_name
varchar
(
100
)
NULL
,
contact_surname
varchar
(
100
)
NULL
,
contact_surname
varchar
(
100
)
NULL
,
...
...
cmsWebApp/sql/oracle/Client.sql
View file @
84725807
...
@@ -9,8 +9,8 @@ CREATE TABLE tl_client (
...
@@ -9,8 +9,8 @@ CREATE TABLE tl_client (
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
,
,
c
ompany
_name
varchar2
(
100
)
NOT
NULL
,
c
lient
_name
varchar2
(
100
)
NOT
NULL
,
c
ompany
_logo
blob
NULL
,
c
lient
_logo
blob
NULL
,
email
varchar2
(
100
)
NULL
,
email
varchar2
(
100
)
NULL
,
contact_name
varchar2
(
100
)
NULL
,
contact_name
varchar2
(
100
)
NULL
,
contact_surname
varchar2
(
100
)
NULL
,
contact_surname
varchar2
(
100
)
NULL
,
...
...
cmsWebApp/sql/postgres/Client.sql
View file @
84725807
...
@@ -9,8 +9,8 @@ CREATE TABLE tl_client (
...
@@ -9,8 +9,8 @@ CREATE TABLE tl_client (
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
,
,
c
ompany
_name
varchar
(
100
)
NOT
NULL
,
c
lient
_name
varchar
(
100
)
NOT
NULL
,
c
ompany
_logo
bytea
NULL
,
c
lient
_logo
bytea
NULL
,
email
varchar
(
100
)
NULL
,
email
varchar
(
100
)
NULL
,
contact_name
varchar
(
100
)
NULL
,
contact_name
varchar
(
100
)
NULL
,
contact_surname
varchar
(
100
)
NULL
,
contact_surname
varchar
(
100
)
NULL
,
...
...
cmsWebApp/src/performa/orm/BaseClient.java
View file @
84725807
...
@@ -42,8 +42,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -42,8 +42,8 @@ public abstract class BaseClient extends BaseBusinessClass
// Static constants corresponding to field names
// Static constants corresponding to field names
public
static
final
String
FIELD_C
ompanyName
=
"Company
Name"
;
public
static
final
String
FIELD_C
lientName
=
"Client
Name"
;
public
static
final
String
FIELD_C
ompanyLogo
=
"Company
Logo"
;
public
static
final
String
FIELD_C
lientLogo
=
"Client
Logo"
;
public
static
final
String
FIELD_Email
=
"Email"
;
public
static
final
String
FIELD_Email
=
"Email"
;
public
static
final
String
FIELD_ContactName
=
"ContactName"
;
public
static
final
String
FIELD_ContactName
=
"ContactName"
;
public
static
final
String
FIELD_ContactSurname
=
"ContactSurname"
;
public
static
final
String
FIELD_ContactSurname
=
"ContactSurname"
;
...
@@ -59,8 +59,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -59,8 +59,8 @@ public abstract class BaseClient extends BaseBusinessClass
// Static constants corresponding to attribute helpers
// Static constants corresponding to attribute helpers
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_C
ompany
Name
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_C
lient
Name
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
BLOBAttributeHelper
HELPER_C
ompany
Logo
=
BLOBAttributeHelper
.
INSTANCE
;
private
static
final
BLOBAttributeHelper
HELPER_C
lient
Logo
=
BLOBAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_Email
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_Email
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_ContactName
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_ContactName
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_ContactSurname
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_ContactSurname
=
DefaultAttributeHelper
.
INSTANCE
;
...
@@ -71,8 +71,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -71,8 +71,8 @@ public abstract class BaseClient extends BaseBusinessClass
// Private attributes corresponding to business object data
// Private attributes corresponding to business object data
private
String
_C
ompany
Name
;
private
String
_C
lient
Name
;
private
BinaryContent
_C
ompany
Logo
;
private
BinaryContent
_C
lient
Logo
;
private
String
_Email
;
private
String
_Email
;
private
String
_ContactName
;
private
String
_ContactName
;
private
String
_ContactSurname
;
private
String
_ContactSurname
;
...
@@ -93,8 +93,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -93,8 +93,8 @@ public abstract class BaseClient extends BaseBusinessClass
private
static
final
Map
ATTRIBUTES_METADATA_Client
=
new
HashMap
();
private
static
final
Map
ATTRIBUTES_METADATA_Client
=
new
HashMap
();
// Arrays of validators for each attribute
// Arrays of validators for each attribute
private
static
final
AttributeValidator
[]
FIELD_C
ompany
Name_Validators
;
private
static
final
AttributeValidator
[]
FIELD_C
lient
Name_Validators
;
private
static
final
AttributeValidator
[]
FIELD_C
ompany
Logo_Validators
;
private
static
final
AttributeValidator
[]
FIELD_C
lient
Logo_Validators
;
private
static
final
AttributeValidator
[]
FIELD_Email_Validators
;
private
static
final
AttributeValidator
[]
FIELD_Email_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ContactName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ContactName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ContactSurname_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ContactSurname_Validators
;
...
@@ -117,8 +117,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -117,8 +117,8 @@ public abstract class BaseClient extends BaseBusinessClass
Map
validatorMapping
=
((
Map
)
ConfigMgr
.
getConfigObject
(
"CONFIG.ORMVALIDATOR"
,
"ValidatorMapping"
));
Map
validatorMapping
=
((
Map
)
ConfigMgr
.
getConfigObject
(
"CONFIG.ORMVALIDATOR"
,
"ValidatorMapping"
));
setupAssocMetaData_Company
();
setupAssocMetaData_Company
();
FIELD_C
ompanyName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Company
Name
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_C
lientName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Client
Name
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_C
ompanyLogo_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Company
Logo
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_C
lientLogo_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Client
Logo
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_Email_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Email
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_Email_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Email
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ContactName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ContactName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ContactName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ContactName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ContactSurname_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ContactSurname
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ContactSurname_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ContactSurname
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
...
@@ -156,43 +156,43 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -156,43 +156,43 @@ public abstract class BaseClient extends BaseBusinessClass
// Meta Info setup
// Meta Info setup
private
static
List
setupAttribMetaData_C
ompany
Name
(
Map
validatorMapping
)
private
static
List
setupAttribMetaData_C
lient
Name
(
Map
validatorMapping
)
{
{
Map
metaInfo
=
new
HashMap
();
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"dbcol"
,
"c
ompany
_name"
);
metaInfo
.
put
(
"dbcol"
,
"c
lient
_name"
);
metaInfo
.
put
(
"length"
,
"100"
);
metaInfo
.
put
(
"length"
,
"100"
);
metaInfo
.
put
(
"mandatory"
,
"true"
);
metaInfo
.
put
(
"mandatory"
,
"true"
);
metaInfo
.
put
(
"name"
,
"C
ompany
Name"
);
metaInfo
.
put
(
"name"
,
"C
lient
Name"
);
metaInfo
.
put
(
"type"
,
"String"
);
metaInfo
.
put
(
"type"
,
"String"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Client.C
ompany
Name:"
,
metaInfo
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Client.C
lient
Name:"
,
metaInfo
);
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_C
ompany
Name
,
Collections
.
unmodifiableMap
(
metaInfo
));
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_C
lient
Name
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"C
ompany
Name"
,
metaInfo
,
validatorMapping
);
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"C
lient
Name"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.C
ompany
Name:"
,
validators
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.C
lient
Name:"
,
validators
);
return
validators
;
return
validators
;
}
}
// Meta Info setup
// Meta Info setup
private
static
List
setupAttribMetaData_C
ompany
Logo
(
Map
validatorMapping
)
private
static
List
setupAttribMetaData_C
lient
Logo
(
Map
validatorMapping
)
{
{
Map
metaInfo
=
new
HashMap
();
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"attribHelper"
,
"BLOBAttributeHelper"
);
metaInfo
.
put
(
"attribHelper"
,
"BLOBAttributeHelper"
);
metaInfo
.
put
(
"attribHelperInstance"
,
"BLOBAttributeHelper.INSTANCE"
);
metaInfo
.
put
(
"attribHelperInstance"
,
"BLOBAttributeHelper.INSTANCE"
);
metaInfo
.
put
(
"binaryHandler"
,
"loggedin"
);
metaInfo
.
put
(
"binaryHandler"
,
"loggedin"
);
metaInfo
.
put
(
"dbcol"
,
"c
ompany
_logo"
);
metaInfo
.
put
(
"dbcol"
,
"c
lient
_logo"
);
metaInfo
.
put
(
"mandatory"
,
"false"
);
metaInfo
.
put
(
"mandatory"
,
"false"
);
metaInfo
.
put
(
"name"
,
"C
ompany
Logo"
);
metaInfo
.
put
(
"name"
,
"C
lient
Logo"
);
metaInfo
.
put
(
"type"
,
"BinaryContent"
);
metaInfo
.
put
(
"type"
,
"BinaryContent"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Client.C
ompany
Logo:"
,
metaInfo
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Client.C
lient
Logo:"
,
metaInfo
);
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_C
ompany
Logo
,
Collections
.
unmodifiableMap
(
metaInfo
));
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_C
lient
Logo
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"C
ompany
Logo"
,
metaInfo
,
validatorMapping
);
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"C
lient
Logo"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.C
ompany
Logo:"
,
validators
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.C
lient
Logo:"
,
validators
);
return
validators
;
return
validators
;
}
}
...
@@ -367,8 +367,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -367,8 +367,8 @@ public abstract class BaseClient extends BaseBusinessClass
super
.
_initialiseNewObjAttributes
(
transaction
);
super
.
_initialiseNewObjAttributes
(
transaction
);
_C
ompanyName
=
(
String
)(
HELPER_CompanyName
.
initialise
(
_Company
Name
));
_C
lientName
=
(
String
)(
HELPER_ClientName
.
initialise
(
_Client
Name
));
_C
ompanyLogo
=
(
BinaryContent
)(
HELPER_CompanyLogo
.
initialise
(
_Company
Logo
));
_C
lientLogo
=
(
BinaryContent
)(
HELPER_ClientLogo
.
initialise
(
_Client
Logo
));
_Email
=
(
String
)(
HELPER_Email
.
initialise
(
_Email
));
_Email
=
(
String
)(
HELPER_Email
.
initialise
(
_Email
));
_ContactName
=
(
String
)(
HELPER_ContactName
.
initialise
(
_ContactName
));
_ContactName
=
(
String
)(
HELPER_ContactName
.
initialise
(
_ContactName
));
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
initialise
(
_ContactSurname
));
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
initialise
(
_ContactSurname
));
...
@@ -403,16 +403,16 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -403,16 +403,16 @@ public abstract class BaseClient extends BaseBusinessClass
/**
/**
* Get the attribute C
ompany
Name
* Get the attribute C
lient
Name
*/
*/
public
String
getC
ompany
Name
()
public
String
getC
lient
Name
()
{
{
assertValid
();
assertValid
();
String
valToReturn
=
_C
ompany
Name
;
String
valToReturn
=
_C
lient
Name
;
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
{
valToReturn
=
bhd
.
getC
ompany
Name
((
Client
)
this
,
valToReturn
);
valToReturn
=
bhd
.
getC
lient
Name
((
Client
)
this
,
valToReturn
);
}
}
return
valToReturn
;
return
valToReturn
;
...
@@ -424,7 +424,7 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -424,7 +424,7 @@ public abstract class BaseClient extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
*/
protected
void
preC
ompanyNameChange
(
String
newCompany
Name
)
throws
FieldException
protected
void
preC
lientNameChange
(
String
newClient
Name
)
throws
FieldException
{
{
}
}
...
@@ -434,47 +434,47 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -434,47 +434,47 @@ public abstract class BaseClient extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
* may lead to the TX being rolled back
*/
*/
protected
void
postC
ompany
NameChange
()
throws
FieldException
protected
void
postC
lient
NameChange
()
throws
FieldException
{
{
}
}
public
FieldWriteability
getWriteability_C
ompany
Name
()
public
FieldWriteability
getWriteability_C
lient
Name
()
{
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
}
/**
/**
* Set the attribute C
ompany
Name. Checks to ensure a new value
* Set the attribute C
lient
Name. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
*/
public
void
setC
ompanyName
(
String
newCompany
Name
)
throws
FieldException
public
void
setC
lientName
(
String
newClient
Name
)
throws
FieldException
{
{
boolean
oldAndNewIdentical
=
HELPER_C
ompanyName
.
compare
(
_CompanyName
,
newCompany
Name
);
boolean
oldAndNewIdentical
=
HELPER_C
lientName
.
compare
(
_ClientName
,
newClient
Name
);
try
try
{
{
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
{
newC
ompanyName
=
bhd
.
setCompanyName
((
Client
)
this
,
newCompany
Name
);
newC
lientName
=
bhd
.
setClientName
((
Client
)
this
,
newClient
Name
);
oldAndNewIdentical
=
HELPER_C
ompanyName
.
compare
(
_CompanyName
,
newCompany
Name
);
oldAndNewIdentical
=
HELPER_C
lientName
.
compare
(
_ClientName
,
newClient
Name
);
}
}
BusinessObjectParser
.
assertFieldCondition
(
newC
ompanyName
!=
null
,
this
,
FIELD_Company
Name
,
"mandatory"
);
BusinessObjectParser
.
assertFieldCondition
(
newC
lientName
!=
null
,
this
,
FIELD_Client
Name
,
"mandatory"
);
if
(
FIELD_C
ompany
Name_Validators
.
length
>
0
)
if
(
FIELD_C
lient
Name_Validators
.
length
>
0
)
{
{
Object
newC
ompanyNameObj
=
HELPER_CompanyName
.
toObject
(
newCompany
Name
);
Object
newC
lientNameObj
=
HELPER_ClientName
.
toObject
(
newClient
Name
);
if
(
newC
ompany
NameObj
!=
null
)
if
(
newC
lient
NameObj
!=
null
)
{
{
int
loopMax
=
FIELD_C
ompany
Name_Validators
.
length
;
int
loopMax
=
FIELD_C
lient
Name_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Client
.
get
(
FIELD_C
ompany
Name
);
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Client
.
get
(
FIELD_C
lient
Name
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
{
FIELD_C
ompanyName_Validators
[
v
].
checkAttribute
(
this
,
FIELD_CompanyName
,
metadata
,
newCompany
NameObj
);
FIELD_C
lientName_Validators
[
v
].
checkAttribute
(
this
,
FIELD_ClientName
,
metadata
,
newClient
NameObj
);
}
}
}
}
}
}
...
@@ -492,26 +492,26 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -492,26 +492,26 @@ public abstract class BaseClient extends BaseBusinessClass
if
(!
oldAndNewIdentical
)
if
(!
oldAndNewIdentical
)
{
{
assertValid
();
assertValid
();
Debug
.
assertion
(
getWriteability_C
ompanyName
()
!=
FieldWriteability
.
FALSE
,
"Field Company
Name is not writeable"
);
Debug
.
assertion
(
getWriteability_C
lientName
()
!=
FieldWriteability
.
FALSE
,
"Field Client
Name is not writeable"
);
preC
ompanyNameChange
(
newCompany
Name
);
preC
lientNameChange
(
newClient
Name
);
markFieldChange
(
FIELD_C
ompany
Name
);
markFieldChange
(
FIELD_C
lient
Name
);
_C
ompanyName
=
newCompany
Name
;
_C
lientName
=
newClient
Name
;
postFieldChange
(
FIELD_C
ompany
Name
);
postFieldChange
(
FIELD_C
lient
Name
);
postC
ompany
NameChange
();
postC
lient
NameChange
();
}
}
}
}
/**
/**
* Get the attribute C
ompany
Logo
* Get the attribute C
lient
Logo
*/
*/
public
BinaryContent
getC
ompany
Logo
()
public
BinaryContent
getC
lient
Logo
()
{
{
assertValid
();
assertValid
();
BinaryContent
valToReturn
=
_C
ompany
Logo
;
BinaryContent
valToReturn
=
_C
lient
Logo
;
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
{
valToReturn
=
bhd
.
getC
ompany
Logo
((
Client
)
this
,
valToReturn
);
valToReturn
=
bhd
.
getC
lient
Logo
((
Client
)
this
,
valToReturn
);
}
}
return
valToReturn
;
return
valToReturn
;
...
@@ -523,7 +523,7 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -523,7 +523,7 @@ public abstract class BaseClient extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
*/
protected
void
preC
ompanyLogoChange
(
BinaryContent
newCompany
Logo
)
throws
FieldException
protected
void
preC
lientLogoChange
(
BinaryContent
newClient
Logo
)
throws
FieldException
{
{
}
}
...
@@ -533,46 +533,46 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -533,46 +533,46 @@ public abstract class BaseClient extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
* may lead to the TX being rolled back
*/
*/
protected
void
postC
ompany
LogoChange
()
throws
FieldException
protected
void
postC
lient
LogoChange
()
throws
FieldException
{
{
}
}
public
FieldWriteability
getWriteability_C
ompany
Logo
()
public
FieldWriteability
getWriteability_C
lient
Logo
()
{
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
}
/**
/**
* Set the attribute C
ompany
Logo. Checks to ensure a new value
* Set the attribute C
lient
Logo. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
*/
public
void
setC
ompanyLogo
(
BinaryContent
newCompany
Logo
)
throws
FieldException
public
void
setC
lientLogo
(
BinaryContent
newClient
Logo
)
throws
FieldException
{
{
boolean
oldAndNewIdentical
=
HELPER_C
ompanyLogo
.
compare
(
_CompanyLogo
,
newCompany
Logo
);
boolean
oldAndNewIdentical
=
HELPER_C
lientLogo
.
compare
(
_ClientLogo
,
newClient
Logo
);
try
try
{
{
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
{
newC
ompanyLogo
=
bhd
.
setCompanyLogo
((
Client
)
this
,
newCompany
Logo
);
newC
lientLogo
=
bhd
.
setClientLogo
((
Client
)
this
,
newClient
Logo
);
oldAndNewIdentical
=
HELPER_C
ompanyLogo
.
compare
(
_CompanyLogo
,
newCompany
Logo
);
oldAndNewIdentical
=
HELPER_C
lientLogo
.
compare
(
_ClientLogo
,
newClient
Logo
);
}
}
if
(
FIELD_C
ompany
Logo_Validators
.
length
>
0
)
if
(
FIELD_C
lient
Logo_Validators
.
length
>
0
)
{
{
Object
newC
ompanyLogoObj
=
HELPER_CompanyLogo
.
toObject
(
newCompany
Logo
);
Object
newC
lientLogoObj
=
HELPER_ClientLogo
.
toObject
(
newClient
Logo
);
if
(
newC
ompany
LogoObj
!=
null
)
if
(
newC
lient
LogoObj
!=
null
)
{
{
int
loopMax
=
FIELD_C
ompany
Logo_Validators
.
length
;
int
loopMax
=
FIELD_C
lient
Logo_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Client
.
get
(
FIELD_C
ompany
Logo
);
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Client
.
get
(
FIELD_C
lient
Logo
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
{
FIELD_C
ompanyLogo_Validators
[
v
].
checkAttribute
(
this
,
FIELD_CompanyLogo
,
metadata
,
newCompany
LogoObj
);
FIELD_C
lientLogo_Validators
[
v
].
checkAttribute
(
this
,
FIELD_ClientLogo
,
metadata
,
newClient
LogoObj
);
}
}
}
}
}
}
...
@@ -590,12 +590,12 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -590,12 +590,12 @@ public abstract class BaseClient extends BaseBusinessClass
if
(!
oldAndNewIdentical
)
if
(!
oldAndNewIdentical
)
{
{
assertValid
();
assertValid
();
Debug
.
assertion
(
getWriteability_C
ompanyLogo
()
!=
FieldWriteability
.
FALSE
,
"Field Company
Logo is not writeable"
);
Debug
.
assertion
(
getWriteability_C
lientLogo
()
!=
FieldWriteability
.
FALSE
,
"Field Client
Logo is not writeable"
);
preC
ompanyLogoChange
(
newCompany
Logo
);
preC
lientLogoChange
(
newClient
Logo
);
markFieldChange
(
FIELD_C
ompany
Logo
);
markFieldChange
(
FIELD_C
lient
Logo
);
_C
ompanyLogo
=
newCompany
Logo
;
_C
lientLogo
=
newClient
Logo
;
postFieldChange
(
FIELD_C
ompany
Logo
);
postFieldChange
(
FIELD_C
lient
Logo
);
postC
ompany
LogoChange
();
postC
lient
LogoChange
();
}
}
}
}
...
@@ -1684,8 +1684,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1684,8 +1684,8 @@ public abstract class BaseClient extends BaseBusinessClass
PersistentSet
tl_clientPSet
=
allSets
.
getPersistentSet
(
myID
,
"tl_client"
,
myPSetStatus
);
PersistentSet
tl_clientPSet
=
allSets
.
getPersistentSet
(
myID
,
"tl_client"
,
myPSetStatus
);
tl_clientPSet
.
setAttrib
(
FIELD_ObjectID
,
myID
);
tl_clientPSet
.
setAttrib
(
FIELD_ObjectID
,
myID
);
tl_clientPSet
.
setAttrib
(
FIELD_C
ompanyName
,
HELPER_CompanyName
.
toObject
(
_Company
Name
));
//
tl_clientPSet
.
setAttrib
(
FIELD_C
lientName
,
HELPER_ClientName
.
toObject
(
_Client
Name
));
//
tl_clientPSet
.
setAttrib
(
FIELD_C
ompanyLogo
,
HELPER_CompanyLogo
.
toObject
(
_Company
Logo
));
//
tl_clientPSet
.
setAttrib
(
FIELD_C
lientLogo
,
HELPER_ClientLogo
.
toObject
(
_Client
Logo
));
//
tl_clientPSet
.
setAttrib
(
FIELD_Email
,
HELPER_Email
.
toObject
(
_Email
));
//
tl_clientPSet
.
setAttrib
(
FIELD_Email
,
HELPER_Email
.
toObject
(
_Email
));
//
tl_clientPSet
.
setAttrib
(
FIELD_ContactName
,
HELPER_ContactName
.
toObject
(
_ContactName
));
//
tl_clientPSet
.
setAttrib
(
FIELD_ContactName
,
HELPER_ContactName
.
toObject
(
_ContactName
));
//
tl_clientPSet
.
setAttrib
(
FIELD_ContactSurname
,
HELPER_ContactSurname
.
toObject
(
_ContactSurname
));
//
tl_clientPSet
.
setAttrib
(
FIELD_ContactSurname
,
HELPER_ContactSurname
.
toObject
(
_ContactSurname
));
//
...
@@ -1708,8 +1708,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1708,8 +1708,8 @@ public abstract class BaseClient extends BaseBusinessClass
PersistentSet
tl_clientPSet
=
allSets
.
getPersistentSet
(
objectID
,
"tl_client"
);
PersistentSet
tl_clientPSet
=
allSets
.
getPersistentSet
(
objectID
,
"tl_client"
);
_C
ompanyName
=
(
String
)(
HELPER_CompanyName
.
fromObject
(
_CompanyName
,
tl_clientPSet
.
getAttrib
(
FIELD_Company
Name
)));
//
_C
lientName
=
(
String
)(
HELPER_ClientName
.
fromObject
(
_ClientName
,
tl_clientPSet
.
getAttrib
(
FIELD_Client
Name
)));
//
_C
ompanyLogo
=
(
BinaryContent
)(
HELPER_CompanyLogo
.
fromObject
(
_CompanyLogo
,
tl_clientPSet
.
getAttrib
(
FIELD_Company
Logo
)));
//
_C
lientLogo
=
(
BinaryContent
)(
HELPER_ClientLogo
.
fromObject
(
_ClientLogo
,
tl_clientPSet
.
getAttrib
(
FIELD_Client
Logo
)));
//
_Email
=
(
String
)(
HELPER_Email
.
fromObject
(
_Email
,
tl_clientPSet
.
getAttrib
(
FIELD_Email
)));
//
_Email
=
(
String
)(
HELPER_Email
.
fromObject
(
_Email
,
tl_clientPSet
.
getAttrib
(
FIELD_Email
)));
//
_ContactName
=
(
String
)(
HELPER_ContactName
.
fromObject
(
_ContactName
,
tl_clientPSet
.
getAttrib
(
FIELD_ContactName
)));
//
_ContactName
=
(
String
)(
HELPER_ContactName
.
fromObject
(
_ContactName
,
tl_clientPSet
.
getAttrib
(
FIELD_ContactName
)));
//
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
fromObject
(
_ContactSurname
,
tl_clientPSet
.
getAttrib
(
FIELD_ContactSurname
)));
//
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
fromObject
(
_ContactSurname
,
tl_clientPSet
.
getAttrib
(
FIELD_ContactSurname
)));
//
...
@@ -1735,7 +1735,7 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1735,7 +1735,7 @@ public abstract class BaseClient extends BaseBusinessClass
try
try
{
{
setC
ompanyName
(
otherClient
.
getCompany
Name
());
setC
lientName
(
otherClient
.
getClient
Name
());
}
}
catch
(
FieldException
ex
)
catch
(
FieldException
ex
)
{
{
...
@@ -1744,7 +1744,7 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1744,7 +1744,7 @@ public abstract class BaseClient extends BaseBusinessClass
try
try
{
{
setC
ompanyLogo
(
otherClient
.
getCompany
Logo
());
setC
lientLogo
(
otherClient
.
getClient
Logo
());
}
}
catch
(
FieldException
ex
)
catch
(
FieldException
ex
)
{
{
...
@@ -1829,8 +1829,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1829,8 +1829,8 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
BaseClient
sourceClient
=
(
BaseClient
)(
source
);
BaseClient
sourceClient
=
(
BaseClient
)(
source
);
_C
ompanyName
=
sourceClient
.
_Company
Name
;
_C
lientName
=
sourceClient
.
_Client
Name
;
_C
ompanyLogo
=
sourceClient
.
_Company
Logo
;
_C
lientLogo
=
sourceClient
.
_Client
Logo
;
_Email
=
sourceClient
.
_Email
;
_Email
=
sourceClient
.
_Email
;
_ContactName
=
sourceClient
.
_ContactName
;
_ContactName
=
sourceClient
.
_ContactName
;
_ContactSurname
=
sourceClient
.
_ContactSurname
;
_ContactSurname
=
sourceClient
.
_ContactSurname
;
...
@@ -1891,8 +1891,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1891,8 +1891,8 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
super
.
readExternalData
(
vals
);
super
.
readExternalData
(
vals
);
_C
ompanyName
=
(
String
)(
HELPER_CompanyName
.
readExternal
(
_CompanyName
,
vals
.
get
(
FIELD_Company
Name
)));
//
_C
lientName
=
(
String
)(
HELPER_ClientName
.
readExternal
(
_ClientName
,
vals
.
get
(
FIELD_Client
Name
)));
//
_C
ompanyLogo
=
(
BinaryContent
)(
HELPER_CompanyLogo
.
readExternal
(
_CompanyLogo
,
vals
.
get
(
FIELD_Company
Logo
)));
//
_C
lientLogo
=
(
BinaryContent
)(
HELPER_ClientLogo
.
readExternal
(
_ClientLogo
,
vals
.
get
(
FIELD_Client
Logo
)));
//
_Email
=
(
String
)(
HELPER_Email
.
readExternal
(
_Email
,
vals
.
get
(
FIELD_Email
)));
//
_Email
=
(
String
)(
HELPER_Email
.
readExternal
(
_Email
,
vals
.
get
(
FIELD_Email
)));
//
_ContactName
=
(
String
)(
HELPER_ContactName
.
readExternal
(
_ContactName
,
vals
.
get
(
FIELD_ContactName
)));
//
_ContactName
=
(
String
)(
HELPER_ContactName
.
readExternal
(
_ContactName
,
vals
.
get
(
FIELD_ContactName
)));
//
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
readExternal
(
_ContactSurname
,
vals
.
get
(
FIELD_ContactSurname
)));
//
_ContactSurname
=
(
String
)(
HELPER_ContactSurname
.
readExternal
(
_ContactSurname
,
vals
.
get
(
FIELD_ContactSurname
)));
//
...
@@ -1912,8 +1912,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1912,8 +1912,8 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
super
.
writeExternalData
(
vals
);
super
.
writeExternalData
(
vals
);
vals
.
put
(
FIELD_C
ompanyName
,
HELPER_CompanyName
.
writeExternal
(
_Company
Name
));
vals
.
put
(
FIELD_C
lientName
,
HELPER_ClientName
.
writeExternal
(
_Client
Name
));
vals
.
put
(
FIELD_C
ompanyLogo
,
HELPER_CompanyLogo
.
writeExternal
(
_Company
Logo
));
vals
.
put
(
FIELD_C
lientLogo
,
HELPER_ClientLogo
.
writeExternal
(
_Client
Logo
));
vals
.
put
(
FIELD_Email
,
HELPER_Email
.
writeExternal
(
_Email
));
vals
.
put
(
FIELD_Email
,
HELPER_Email
.
writeExternal
(
_Email
));
vals
.
put
(
FIELD_ContactName
,
HELPER_ContactName
.
writeExternal
(
_ContactName
));
vals
.
put
(
FIELD_ContactName
,
HELPER_ContactName
.
writeExternal
(
_ContactName
));
vals
.
put
(
FIELD_ContactSurname
,
HELPER_ContactSurname
.
writeExternal
(
_ContactSurname
));
vals
.
put
(
FIELD_ContactSurname
,
HELPER_ContactSurname
.
writeExternal
(
_ContactSurname
));
...
@@ -1935,13 +1935,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1935,13 +1935,13 @@ public abstract class BaseClient extends BaseBusinessClass
BaseClient
otherClient
=
(
BaseClient
)(
other
);
BaseClient
otherClient
=
(
BaseClient
)(
other
);
if
(!
HELPER_C
ompanyName
.
compare
(
this
.
_CompanyName
,
otherClient
.
_Company
Name
))
if
(!
HELPER_C
lientName
.
compare
(
this
.
_ClientName
,
otherClient
.
_Client
Name
))
{
{
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_C
ompanyName
,
HELPER_CompanyName
.
toObject
(
this
.
_CompanyName
),
HELPER_CompanyName
.
toObject
(
otherClient
.
_Company
Name
));
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_C
lientName
,
HELPER_ClientName
.
toObject
(
this
.
_ClientName
),
HELPER_ClientName
.
toObject
(
otherClient
.
_Client
Name
));
}
}
if
(!
HELPER_C
ompanyLogo
.
compare
(
this
.
_CompanyLogo
,
otherClient
.
_Company
Logo
))
if
(!
HELPER_C
lientLogo
.
compare
(
this
.
_ClientLogo
,
otherClient
.
_Client
Logo
))
{
{
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_C
ompanyLogo
,
HELPER_CompanyLogo
.
toObject
(
this
.
_CompanyLogo
),
HELPER_CompanyLogo
.
toObject
(
otherClient
.
_Company
Logo
));
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_C
lientLogo
,
HELPER_ClientLogo
.
toObject
(
this
.
_ClientLogo
),
HELPER_ClientLogo
.
toObject
(
otherClient
.
_Client
Logo
));
}
}
if
(!
HELPER_Email
.
compare
(
this
.
_Email
,
otherClient
.
_Email
))
if
(!
HELPER_Email
.
compare
(
this
.
_Email
,
otherClient
.
_Email
))
{
{
...
@@ -1994,8 +1994,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1994,8 +1994,8 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
super
.
visitAttributes
(
visitor
);
super
.
visitAttributes
(
visitor
);
visitor
.
visitField
(
this
,
FIELD_C
ompanyName
,
HELPER_CompanyName
.
toObject
(
getCompany
Name
()));
visitor
.
visitField
(
this
,
FIELD_C
lientName
,
HELPER_ClientName
.
toObject
(
getClient
Name
()));
visitor
.
visitField
(
this
,
FIELD_C
ompanyLogo
,
HELPER_CompanyLogo
.
toObject
(
getCompany
Logo
()));
visitor
.
visitField
(
this
,
FIELD_C
lientLogo
,
HELPER_ClientLogo
.
toObject
(
getClient
Logo
()));
visitor
.
visitField
(
this
,
FIELD_Email
,
HELPER_Email
.
toObject
(
getEmail
()));
visitor
.
visitField
(
this
,
FIELD_Email
,
HELPER_Email
.
toObject
(
getEmail
()));
visitor
.
visitField
(
this
,
FIELD_ContactName
,
HELPER_ContactName
.
toObject
(
getContactName
()));
visitor
.
visitField
(
this
,
FIELD_ContactName
,
HELPER_ContactName
.
toObject
(
getContactName
()));
visitor
.
visitField
(
this
,
FIELD_ContactSurname
,
HELPER_ContactSurname
.
toObject
(
getContactSurname
()));
visitor
.
visitField
(
this
,
FIELD_ContactSurname
,
HELPER_ContactSurname
.
toObject
(
getContactSurname
()));
...
@@ -2041,13 +2041,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2041,13 +2041,13 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
throw
new
RuntimeException
(
"Game over man!!"
);
throw
new
RuntimeException
(
"Game over man!!"
);
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Name
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Name
))
{
{
return
filter
.
matches
(
getC
ompany
Name
());
return
filter
.
matches
(
getC
lient
Name
());
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Logo
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Logo
))
{
{
return
filter
.
matches
(
getC
ompany
Logo
());
return
filter
.
matches
(
getC
lient
Logo
());
}
}
else
if
(
attribName
.
equals
(
FIELD_Email
))
else
if
(
attribName
.
equals
(
FIELD_Email
))
{
{
...
@@ -2112,15 +2112,15 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2112,15 +2112,15 @@ public abstract class BaseClient extends BaseBusinessClass
}
}
public
SearchAll
andC
ompany
Name
(
QueryFilter
<
String
>
filter
)
public
SearchAll
andC
lient
Name
(
QueryFilter
<
String
>
filter
)
{
{
filter
.
addFilter
(
context
,
"tl_client.c
ompany_name"
,
"Company
Name"
);
filter
.
addFilter
(
context
,
"tl_client.c
lient_name"
,
"Client
Name"
);
return
this
;
return
this
;
}
}
public
SearchAll
andC
ompany
Logo
(
QueryFilter
<
BinaryContent
>
filter
)
public
SearchAll
andC
lient
Logo
(
QueryFilter
<
BinaryContent
>
filter
)
{
{
filter
.
addFilter
(
context
,
"tl_client.c
ompany_logo"
,
"Company
Logo"
);
filter
.
addFilter
(
context
,
"tl_client.c
lient_logo"
,
"Client
Logo"
);
return
this
;
return
this
;
}
}
...
@@ -2207,13 +2207,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2207,13 +2207,13 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
throw
new
RuntimeException
(
"Game over man!!"
);
throw
new
RuntimeException
(
"Game over man!!"
);
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Name
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Name
))
{
{
return
HELPER_C
ompanyName
.
toObject
(
getCompany
Name
());
return
HELPER_C
lientName
.
toObject
(
getClient
Name
());
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Logo
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Logo
))
{
{
return
HELPER_C
ompanyLogo
.
toObject
(
getCompany
Logo
());
return
HELPER_C
lientLogo
.
toObject
(
getClient
Logo
());
}
}
else
if
(
attribName
.
equals
(
FIELD_Email
))
else
if
(
attribName
.
equals
(
FIELD_Email
))
{
{
...
@@ -2256,13 +2256,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2256,13 +2256,13 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
throw
new
RuntimeException
(
"Game over man!!"
);
throw
new
RuntimeException
(
"Game over man!!"
);
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Name
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Name
))
{
{
return
HELPER_C
ompany
Name
;
return
HELPER_C
lient
Name
;
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Logo
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Logo
))
{
{
return
HELPER_C
ompany
Logo
;
return
HELPER_C
lient
Logo
;
}
}
else
if
(
attribName
.
equals
(
FIELD_Email
))
else
if
(
attribName
.
equals
(
FIELD_Email
))
{
{
...
@@ -2305,13 +2305,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2305,13 +2305,13 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
throw
new
RuntimeException
(
"Game over man!!"
);
throw
new
RuntimeException
(
"Game over man!!"
);
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Name
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Name
))
{
{
setC
ompanyName
((
String
)(
HELPER_CompanyName
.
fromObject
(
_Company
Name
,
attribValue
)));
setC
lientName
((
String
)(
HELPER_ClientName
.
fromObject
(
_Client
Name
,
attribValue
)));
}
}
else
if
(
attribName
.
equals
(
FIELD_C
ompany
Logo
))
else
if
(
attribName
.
equals
(
FIELD_C
lient
Logo
))
{
{
setC
ompanyLogo
((
BinaryContent
)(
HELPER_CompanyLogo
.
fromObject
(
_Company
Logo
,
attribValue
)));
setC
lientLogo
((
BinaryContent
)(
HELPER_ClientLogo
.
fromObject
(
_Client
Logo
,
attribValue
)));
}
}
else
if
(
attribName
.
equals
(
FIELD_Email
))
else
if
(
attribName
.
equals
(
FIELD_Email
))
{
{
...
@@ -2361,13 +2361,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2361,13 +2361,13 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
throw
new
RuntimeException
(
"Game over man!!"
);
throw
new
RuntimeException
(
"Game over man!!"
);
}
}
else
if
(
fieldName
.
equals
(
FIELD_C
ompany
Name
))
else
if
(
fieldName
.
equals
(
FIELD_C
lient
Name
))
{
{
return
getWriteability_C
ompany
Name
();
return
getWriteability_C
lient
Name
();
}
}
else
if
(
fieldName
.
equals
(
FIELD_C
ompany
Logo
))
else
if
(
fieldName
.
equals
(
FIELD_C
lient
Logo
))
{
{
return
getWriteability_C
ompany
Logo
();
return
getWriteability_C
lient
Logo
();
}
}
else
if
(
fieldName
.
equals
(
FIELD_Email
))
else
if
(
fieldName
.
equals
(
FIELD_Email
))
{
{
...
@@ -2411,14 +2411,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2411,14 +2411,14 @@ public abstract class BaseClient extends BaseBusinessClass
public
void
putUnwriteable
(
Set
<
String
>
fields
)
public
void
putUnwriteable
(
Set
<
String
>
fields
)
{
{
if
(
getWriteability_C
ompany
Name
()
!=
FieldWriteability
.
TRUE
)
if
(
getWriteability_C
lient
Name
()
!=
FieldWriteability
.
TRUE
)
{
{
fields
.
add
(
FIELD_C
ompany
Name
);
fields
.
add
(
FIELD_C
lient
Name
);
}
}
if
(
getWriteability_C
ompany
Logo
()
!=
FieldWriteability
.
TRUE
)
if
(
getWriteability_C
lient
Logo
()
!=
FieldWriteability
.
TRUE
)
{
{
fields
.
add
(
FIELD_C
ompany
Logo
);
fields
.
add
(
FIELD_C
lient
Logo
);
}
}
if
(
getWriteability_Email
()
!=
FieldWriteability
.
TRUE
)
if
(
getWriteability_Email
()
!=
FieldWriteability
.
TRUE
)
...
@@ -2465,8 +2465,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2465,8 +2465,8 @@ public abstract class BaseClient extends BaseBusinessClass
List
result
=
super
.
getAttributes
();
List
result
=
super
.
getAttributes
();
result
.
add
(
HELPER_C
ompanyName
.
getAttribObject
(
getClass
(),
_CompanyName
,
true
,
FIELD_Company
Name
));
result
.
add
(
HELPER_C
lientName
.
getAttribObject
(
getClass
(),
_ClientName
,
true
,
FIELD_Client
Name
));
result
.
add
(
HELPER_C
ompanyLogo
.
getAttribObject
(
getClass
(),
_CompanyLogo
,
false
,
FIELD_Company
Logo
));
result
.
add
(
HELPER_C
lientLogo
.
getAttribObject
(
getClass
(),
_ClientLogo
,
false
,
FIELD_Client
Logo
));
result
.
add
(
HELPER_Email
.
getAttribObject
(
getClass
(),
_Email
,
false
,
FIELD_Email
));
result
.
add
(
HELPER_Email
.
getAttribObject
(
getClass
(),
_Email
,
false
,
FIELD_Email
));
result
.
add
(
HELPER_ContactName
.
getAttribObject
(
getClass
(),
_ContactName
,
false
,
FIELD_ContactName
));
result
.
add
(
HELPER_ContactName
.
getAttribObject
(
getClass
(),
_ContactName
,
false
,
FIELD_ContactName
));
result
.
add
(
HELPER_ContactSurname
.
getAttribObject
(
getClass
(),
_ContactSurname
,
false
,
FIELD_ContactSurname
));
result
.
add
(
HELPER_ContactSurname
.
getAttribObject
(
getClass
(),
_ContactSurname
,
false
,
FIELD_ContactSurname
));
...
@@ -2516,11 +2516,11 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2516,11 +2516,11 @@ public abstract class BaseClient extends BaseBusinessClass
if
(
bchandler
!=
null
)
if
(
bchandler
!=
null
)
{
{
bchandler
.
preCommit
(
willBeStored
,
this
,
"C
ompany
Logo"
);
bchandler
.
preCommit
(
willBeStored
,
this
,
"C
lient
Logo"
);
}
}
else
else
{
{
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
SYSTEMWARNING
,
"Unknown BinaryContentHandler loggedin on attribute C
ompany
Logo"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
SYSTEMWARNING
,
"Unknown BinaryContentHandler loggedin on attribute C
lient
Logo"
);
}
}
}
}
...
@@ -2530,7 +2530,7 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2530,7 +2530,7 @@ public abstract class BaseClient extends BaseBusinessClass
public
oneit
.
servlets
.
objstore
.
binary
.
BinaryContentHandler
getBinaryContentHandler
(
String
attribName
)
public
oneit
.
servlets
.
objstore
.
binary
.
BinaryContentHandler
getBinaryContentHandler
(
String
attribName
)
{
{
if
(
CollectionUtils
.
equals
(
attribName
,
"C
ompany
Logo"
))
if
(
CollectionUtils
.
equals
(
attribName
,
"C
lient
Logo"
))
{
{
return
oneit
.
servlets
.
objstore
.
binary
.
BinaryContentServlet
.
getHandler
(
"loggedin"
);
return
oneit
.
servlets
.
objstore
.
binary
.
BinaryContentServlet
.
getHandler
(
"loggedin"
);
}
}
...
@@ -2543,39 +2543,39 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2543,39 +2543,39 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
/**
/**
* Get the attribute C
ompany
Name
* Get the attribute C
lient
Name
*/
*/
public
String
getC
ompany
Name
(
Client
obj
,
String
original
)
public
String
getC
lient
Name
(
Client
obj
,
String
original
)
{
{
return
original
;
return
original
;
}
}
/**
/**
* Change the value set for attribute C
ompany
Name.
* Change the value set for attribute C
lient
Name.
* May modify the field beforehand
* May modify the field beforehand
* Occurs before validation.
* Occurs before validation.
*/
*/
public
String
setC
ompanyName
(
Client
obj
,
String
newCompany
Name
)
throws
FieldException
public
String
setC
lientName
(
Client
obj
,
String
newClient
Name
)
throws
FieldException
{
{
return
newC
ompany
Name
;
return
newC
lient
Name
;
}
}
/**
/**
* Get the attribute C
ompany
Logo
* Get the attribute C
lient
Logo
*/
*/
public
BinaryContent
getC
ompany
Logo
(
Client
obj
,
BinaryContent
original
)
public
BinaryContent
getC
lient
Logo
(
Client
obj
,
BinaryContent
original
)
{
{
return
original
;
return
original
;
}
}
/**
/**
* Change the value set for attribute C
ompany
Logo.
* Change the value set for attribute C
lient
Logo.
* May modify the field beforehand
* May modify the field beforehand
* Occurs before validation.
* Occurs before validation.
*/
*/
public
BinaryContent
setC
ompanyLogo
(
Client
obj
,
BinaryContent
newCompany
Logo
)
throws
FieldException
public
BinaryContent
setC
lientLogo
(
Client
obj
,
BinaryContent
newClient
Logo
)
throws
FieldException
{
{
return
newC
ompany
Logo
;
return
newC
lient
Logo
;
}
}
/**
/**
...
@@ -2756,13 +2756,13 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2756,13 +2756,13 @@ public abstract class BaseClient extends BaseBusinessClass
public
PipeLine
<
From
,
?
extends
Object
>
to
(
String
name
)
public
PipeLine
<
From
,
?
extends
Object
>
to
(
String
name
)
{
{
if
(
name
.
equals
(
"C
ompany
Name"
))
if
(
name
.
equals
(
"C
lient
Name"
))
{
{
return
toC
ompany
Name
();
return
toC
lient
Name
();
}
}
if
(
name
.
equals
(
"C
ompany
Logo"
))
if
(
name
.
equals
(
"C
lient
Logo"
))
{
{
return
toC
ompany
Logo
();
return
toC
lient
Logo
();
}
}
if
(
name
.
equals
(
"Email"
))
if
(
name
.
equals
(
"Email"
))
{
{
...
@@ -2802,9 +2802,9 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2802,9 +2802,9 @@ public abstract class BaseClient extends BaseBusinessClass
}
}
public
PipeLine
<
From
,
String
>
toC
ompanyName
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_Company
Name
));
}
public
PipeLine
<
From
,
String
>
toC
lientName
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_Client
Name
));
}
public
PipeLine
<
From
,
BinaryContent
>
toC
ompanyLogo
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
BinaryContent
>(
FIELD_Company
Logo
));
}
public
PipeLine
<
From
,
BinaryContent
>
toC
lientLogo
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
BinaryContent
>(
FIELD_Client
Logo
));
}
public
PipeLine
<
From
,
String
>
toEmail
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_Email
));
}
public
PipeLine
<
From
,
String
>
toEmail
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_Email
));
}
...
...
cmsWebApp/src/performa/orm/Client.xml
View file @
84725807
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
<TABLE
name=
"tl_client"
tablePrefix=
"object"
>
<TABLE
name=
"tl_client"
tablePrefix=
"object"
>
<ATTRIB
name=
"C
ompanyName"
type=
"String"
dbcol=
"company_name"
mandatory=
"true"
length=
"100"
/>
<ATTRIB
name=
"C
lientName"
type=
"String"
dbcol=
"client_name"
mandatory=
"true"
length=
"100"
/>
<ATTRIB
name=
"C
ompanyLogo"
type=
"BinaryContent"
dbcol=
"company_logo"
mandatory=
"false"
binaryHandler=
"loggedin"
attribHelper=
"BLOBAttributeHelper"
attribHelperInstance=
"BLOBAttributeHelper.INSTANCE"
/>
<ATTRIB
name=
"C
lientLogo"
type=
"BinaryContent"
dbcol=
"client_logo"
mandatory=
"false"
binaryHandler=
"loggedin"
attribHelper=
"BLOBAttributeHelper"
attribHelperInstance=
"BLOBAttributeHelper.INSTANCE"
/>
<ATTRIB
name=
"Email"
type=
"String"
dbcol=
"email"
mandatory=
"false"
length=
"100"
validators=
"Email"
/>
<ATTRIB
name=
"Email"
type=
"String"
dbcol=
"email"
mandatory=
"false"
length=
"100"
validators=
"Email"
/>
<ATTRIB
name=
"ContactName"
type=
"String"
dbcol=
"contact_name"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactName"
type=
"String"
dbcol=
"contact_name"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactSurname"
type=
"String"
dbcol=
"contact_surname"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactSurname"
type=
"String"
dbcol=
"contact_surname"
mandatory=
"false"
length=
"100"
/>
...
...
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
View file @
84725807
...
@@ -28,8 +28,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -28,8 +28,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
private
static
final
LoggingArea
ClientPersistence
=
LoggingArea
.
createLoggingArea
(
ObjectPersistenceMgr
.
OBJECT_PERSISTENCE
,
"Client"
);
private
static
final
LoggingArea
ClientPersistence
=
LoggingArea
.
createLoggingArea
(
ObjectPersistenceMgr
.
OBJECT_PERSISTENCE
,
"Client"
);
// Private attributes corresponding to business object data
// Private attributes corresponding to business object data
private
String
dummyC
ompany
Name
;
private
String
dummyC
lient
Name
;
private
BinaryContent
dummyC
ompany
Logo
;
private
BinaryContent
dummyC
lient
Logo
;
private
String
dummyEmail
;
private
String
dummyEmail
;
private
String
dummyContactName
;
private
String
dummyContactName
;
private
String
dummyContactSurname
;
private
String
dummyContactSurname
;
...
@@ -40,8 +40,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -40,8 +40,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
// Static constants corresponding to attribute helpers
// Static constants corresponding to attribute helpers
private
static
final
DefaultAttributeHelper
HELPER_C
ompany
Name
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_C
lient
Name
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
BLOBAttributeHelper
HELPER_C
ompany
Logo
=
BLOBAttributeHelper
.
INSTANCE
;
private
static
final
BLOBAttributeHelper
HELPER_C
lient
Logo
=
BLOBAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_Email
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_Email
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_ContactName
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_ContactName
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_ContactSurname
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_ContactSurname
=
DefaultAttributeHelper
.
INSTANCE
;
...
@@ -55,8 +55,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -55,8 +55,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
public
ClientPersistenceMgr
()
public
ClientPersistenceMgr
()
{
{
dummyC
ompanyName
=
(
String
)(
HELPER_CompanyName
.
initialise
(
dummyCompany
Name
));
dummyC
lientName
=
(
String
)(
HELPER_ClientName
.
initialise
(
dummyClient
Name
));
dummyC
ompanyLogo
=
(
BinaryContent
)(
HELPER_CompanyLogo
.
initialise
(
dummyCompany
Logo
));
dummyC
lientLogo
=
(
BinaryContent
)(
HELPER_ClientLogo
.
initialise
(
dummyClient
Logo
));
dummyEmail
=
(
String
)(
HELPER_Email
.
initialise
(
dummyEmail
));
dummyEmail
=
(
String
)(
HELPER_Email
.
initialise
(
dummyEmail
));
dummyContactName
=
(
String
)(
HELPER_ContactName
.
initialise
(
dummyContactName
));
dummyContactName
=
(
String
)(
HELPER_ContactName
.
initialise
(
dummyContactName
));
dummyContactSurname
=
(
String
)(
HELPER_ContactSurname
.
initialise
(
dummyContactSurname
));
dummyContactSurname
=
(
String
)(
HELPER_ContactSurname
.
initialise
(
dummyContactSurname
));
...
@@ -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.c
ompany_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.c
lient_name, {PREFIX}tl_client.client
_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
...
@@ -118,8 +118,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -118,8 +118,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
// Check for persistent sets already prefetched
// Check for persistent sets already prefetched
if
(
false
||
!
tl_clientPSet
.
containsAttrib
(
BaseBusinessClass
.
FIELD_ObjectLastModified
)
||
if
(
false
||
!
tl_clientPSet
.
containsAttrib
(
BaseBusinessClass
.
FIELD_ObjectLastModified
)
||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_C
ompany
Name
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_C
lient
Name
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_C
ompany
Logo
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_C
lient
Logo
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_Email
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_Email
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_ContactName
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_ContactName
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_ContactSurname
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_ContactSurname
)||
...
@@ -207,10 +207,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -207,10 +207,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
{
int
rowsUpdated
=
executeStatement
(
sqlMgr
,
int
rowsUpdated
=
executeStatement
(
sqlMgr
,
"UPDATE {PREFIX}tl_client "
+
"UPDATE {PREFIX}tl_client "
+
"SET c
ompany_name = ?, company
_logo = ?, email = ?, contact_name = ?, contact_surname = ?, phone = ?, state = ?, country = ?, post_code = ?, company_id = ? , object_LAST_UPDATED_DATE = "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
" "
+
"SET c
lient_name = ?, client
_logo = ?, email = ?, contact_name = ?, contact_surname = ?, phone = ?, state = ?, country = ?, post_code = ?, company_id = ? , object_LAST_UPDATED_DATE = "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
" "
+
"WHERE tl_client.object_id = ? AND "
+
getConcurrencyCheck
(
sqlMgr
,
"object_LAST_UPDATED_DATE"
,
obj
.
getObjectLastModified
())
+
" "
,
"WHERE tl_client.object_id = ? AND "
+
getConcurrencyCheck
(
sqlMgr
,
"object_LAST_UPDATED_DATE"
,
obj
.
getObjectLastModified
())
+
" "
,
CollectionUtils
.
listEntry
(
HELPER_C
ompanyName
.
getForSQL
(
dummyCompanyName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_CompanyName
))).
listEntry
(
HELPER_CompanyLogo
.
getForSQL
(
dummyCompanyLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Company
Logo
))).
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
(
obj
.
getObjectLastModified
()).
toList
().
toArray
());
CollectionUtils
.
listEntry
(
HELPER_C
lientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Client
Logo
))).
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
(
obj
.
getObjectLastModified
()).
toList
().
toArray
());
if
(
rowsUpdated
!=
1
)
if
(
rowsUpdated
!=
1
)
{
{
...
@@ -466,8 +466,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -466,8 +466,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
// Object Created
// Object Created
tl_clientPSet
.
setAttrib
(
BaseBusinessClass
.
FIELD_ObjectCreated
,
r
.
getTimestamp
(
"CREATED_DATE"
));
tl_clientPSet
.
setAttrib
(
BaseBusinessClass
.
FIELD_ObjectCreated
,
r
.
getTimestamp
(
"CREATED_DATE"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_C
ompanyName
,
HELPER_CompanyName
.
getFromRS
(
dummyCompanyName
,
r
,
"company
_name"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_C
lientName
,
HELPER_ClientName
.
getFromRS
(
dummyClientName
,
r
,
"client
_name"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_C
ompanyLogo
,
HELPER_CompanyLogo
.
getFromRS
(
dummyCompanyLogo
,
r
,
"company
_logo"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_C
lientLogo
,
HELPER_ClientLogo
.
getFromRS
(
dummyClientLogo
,
r
,
"client
_logo"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_Email
,
HELPER_Email
.
getFromRS
(
dummyEmail
,
r
,
"email"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_Email
,
HELPER_Email
.
getFromRS
(
dummyEmail
,
r
,
"email"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_ContactName
,
HELPER_ContactName
.
getFromRS
(
dummyContactName
,
r
,
"contact_name"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_ContactName
,
HELPER_ContactName
.
getFromRS
(
dummyContactName
,
r
,
"contact_name"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_ContactSurname
,
HELPER_ContactSurname
.
getFromRS
(
dummyContactSurname
,
r
,
"contact_surname"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_ContactSurname
,
HELPER_ContactSurname
.
getFromRS
(
dummyContactSurname
,
r
,
"contact_surname"
));
...
@@ -493,10 +493,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -493,10 +493,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
{
executeStatement
(
sqlMgr
,
executeStatement
(
sqlMgr
,
"INSERT INTO {PREFIX}tl_client "
+
"INSERT INTO {PREFIX}tl_client "
+
" (c
ompany_name, company
_logo, email, contact_name, contact_surname, phone, state, country, post_code, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) "
+
" (c
lient_name, client
_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_C
ompanyName
.
getForSQL
(
dummyCompanyName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_CompanyName
))).
listEntry
(
HELPER_CompanyLogo
.
getForSQL
(
dummyCompanyLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Company
Logo
))).
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
());
CollectionUtils
.
listEntry
(
HELPER_C
lientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Client
Logo
))).
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
);
}
}
...
...
cmsWebApp/webroot/extensions/performa/upgrades/20170901_Alter_Client.sql
0 → 100644
View file @
84725807
-- @AutoRun
ALTER
TABLE
tl_client
RENAME
COLUMN
company_name
TO
client_name
;
ALTER
TABLE
tl_client
RENAME
COLUMN
company_logo
TO
client_logo
;
\ 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