public class PersistenceClassElementImpl extends PersistenceElementImpl implements PersistenceClassElement.Impl
ADD, REMOVE, SET
PROP_CARDINALITY, PROP_COLLECTION_CLASS, PROP_DELETE_ACTION, PROP_ELEMENT_CLASS, PROP_FIELDS, PROP_GROUPS, PROP_IDENTITY, PROP_INVERSE_FIELD, PROP_KEY_CLASS, PROP_KEY_FIELD, PROP_MODIFIED, PROP_NAME, PROP_PERSISTENCE, PROP_PREFETCH, PROP_SENSITIVITY, PROP_UPDATE_ACTION
Constructor and Description |
---|
PersistenceClassElementImpl()
Create new PersistenceClassElementImpl with no corresponding name.
|
PersistenceClassElementImpl(String name)
Creates new PersistenceClassElementImpl with the corresponding name
|
Modifier and Type | Method and Description |
---|---|
void |
changeConcurrencyGroups(ConcurrencyGroupElement[] groups,
int action)
Change the set of concurrency groups.
|
void |
changeFields(PersistenceFieldElement[] fields,
int action)
Change the set of fields.
|
protected void |
firePropertyChange(String name,
Object o,
Object n)
Fires property change event.
|
protected void |
fireVetoableChange(String name,
Object o,
Object n)
Fires vetoable change event.
|
ConcurrencyGroupElement |
getConcurrencyGroup(String name)
Find a concurrency group by name.
|
ConcurrencyGroupElement[] |
getConcurrencyGroups()
Get all concurrency groups.
|
PersistenceFieldElement |
getField(String name)
Find a field by name.
|
PersistenceElementCollection |
getFieldCollection()
Returns the field collection of this class element.
|
PersistenceFieldElement[] |
getFields()
Get all fields.
|
PersistenceElementCollection |
getGroupCollection()
Returns the concurrency group collection of this class element.
|
String |
getKeyClass()
Get the fully qualified name of the primary key class for this class
element.
|
int |
getObjectIdentityType()
Get the object identity type of this class element.
|
boolean |
isModified()
Gets the modified flag for this persistence class.
|
void |
setFieldCollection(PersistenceElementCollection collection)
Set the field collection of this class element to the supplied
collection.
|
void |
setGroupCollection(PersistenceElementCollection collection)
Set the concurrency group collection of this class element to the
supplied collection.
|
void |
setKeyClass(String name)
Set the primary key class for this class element.
|
void |
setModified(boolean flag)
Set the modified flag for this persistence class to flag.
|
void |
setObjectIdentityType(int type)
Set the object identity type of this class element.
|
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
public PersistenceClassElementImpl()
public PersistenceClassElementImpl(String name)
name
- the name of the elementprotected final void firePropertyChange(String name, Object o, Object n)
firePropertyChange
in class PersistenceElementImpl
name
- property nameo
- old valuen
- new valueprotected final void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException
fireVetoableChange
in class PersistenceElementImpl
name
- property nameo
- old valuen
- new valuePropertyVetoException
- when the change is vetoed by a listenerpublic boolean isModified()
isModified
in interface PersistenceClassElement.Impl
true
if there have been (property) changes to this
class, false
otherwise.public void setModified(boolean flag)
true
by property changes and
false
after a save.setModified
in interface PersistenceClassElement.Impl
flag
- if true
, this class is marked as modified;
if false
, it is marked as unmodified.public int getObjectIdentityType()
getObjectIdentityType
in interface PersistenceClassElement.Impl
PersistenceClassElement.APPLICATION_IDENTITY
,
PersistenceClassElement.DATABASE_IDENTITY
, or
PersistenceClassElement.UNMANAGED_IDENTITY
. The default is
APPLICATION_IDENTITY.public void setObjectIdentityType(int type) throws ModelException
setObjectIdentityType
in interface PersistenceClassElement.Impl
type
- - an integer indicating the object identity type, one of:
PersistenceClassElement.APPLICATION_IDENTITY
,
PersistenceClassElement.DATABASE_IDENTITY
, or
PersistenceClassElement.UNMANAGED_IDENTITY
ModelException
- if impossiblepublic String getKeyClass()
getObjectIdentityType
returns APPLICATION_IDENTITY
getKeyClass
in interface PersistenceClassElement.Impl
null
if the
identity type is not managed by the applicationsetObjectIdentityType(int)
,
PersistenceClassElement.APPLICATION_IDENTITY
public void setKeyClass(String name) throws ModelException
setKeyClass
in interface PersistenceClassElement.Impl
name
- - the fully qualified name which represents the primary key
class. This value is only used if getObjectIdentityType
returns APPLICATION_IDENTITY
ModelException
- if impossiblesetObjectIdentityType(int)
,
PersistenceClassElement.APPLICATION_IDENTITY
public void changeFields(PersistenceFieldElement[] fields, int action) throws ModelException
changeFields
in interface PersistenceClassElement.Impl
fields
- the new fieldsaction
- PersistenceElement.Impl.ADD
, PersistenceElement.Impl.REMOVE
, or PersistenceElement.Impl.SET
ModelException
- if impossiblepublic PersistenceFieldElement[] getFields()
getFields
in interface PersistenceClassElement.Impl
public PersistenceFieldElement getField(String name)
getField
in interface PersistenceClassElement.Impl
name
- the name to matchnull
if it does not existpublic void changeConcurrencyGroups(ConcurrencyGroupElement[] groups, int action) throws ModelException
changeConcurrencyGroups
in interface PersistenceClassElement.Impl
groups
- the new concurrency groupsaction
- PersistenceElement.Impl.ADD
, PersistenceElement.Impl.REMOVE
, or PersistenceElement.Impl.SET
ModelException
- if impossiblepublic ConcurrencyGroupElement[] getConcurrencyGroups()
getConcurrencyGroups
in interface PersistenceClassElement.Impl
public ConcurrencyGroupElement getConcurrencyGroup(String name)
getConcurrencyGroup
in interface PersistenceClassElement.Impl
name
- the name to matchnull
if it does not existpublic PersistenceElementCollection getFieldCollection()
public void setFieldCollection(PersistenceElementCollection collection)
collection
- the field collection of this class elementpublic PersistenceElementCollection getGroupCollection()
public void setGroupCollection(PersistenceElementCollection collection)
collection
- the concurrency group collection of this class elementCopyright © 2018. All rights reserved.