public interface MappingClassElement extends MappingElement
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_ALL_AT_COMMIT_CONSISTENCY
Constant representing Consistency level.
|
static int |
CHECK_MODIFIED_AT_COMMIT_CONSISTENCY
Constant representing Consistency level.
|
static int |
LOCK_WHEN_LOADED_CONSISTENCY
Constant representing Consistency level.
|
static int |
LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY
Constant representing Consistency level.
|
static int |
LOCK_WHEN_MODIFIED_CONSISTENCY
Constant representing Consistency level.
|
static String |
MAPPING_EXTENSION
Constant representing mapping file extension.
|
static int |
NONE_CONSISTENCY
Constant representing Consistency level.
|
static int |
VERSION_CONSISTENCY
Constant representing Consistency level.
|
PROP_ASSOCIATED_COLUMNS, PROP_COLUMNS, PROP_CONSISTENCY, PROP_DATABASE_ROOT, PROP_FETCH_GROUP, PROP_FIELDS, PROP_IN_CONCURRENCY_CHECK, PROP_KEY_COLUMNS, PROP_MODIFIED, PROP_NAME, PROP_NAVIGABLE, PROP_READ_ONLY, PROP_REFERENCING_KEYS, PROP_TABLE, PROP_TABLES, PROP_VERSION_FIELD
Modifier and Type | Method and Description |
---|---|
void |
addField(MappingFieldElement field)
Adds a field to the list of fields in this mapping class.
|
MappingReferenceKeyElement |
addSecondaryTable(MappingTableElement parentTable,
org.netbeans.modules.dbschema.TableElement table)
Adds a reference to the supplied table as a secondary table for this
mapping class.
|
void |
addTable(org.netbeans.modules.dbschema.TableElement table)
Convenience method which accepts a table element and attempts to add
it as either a primary or secondary table depending on the existing list
of tables and the foreign keys for the table.
|
int |
getConsistencyLevel()
Gets the consistency level of this mapping class.
|
String |
getDatabaseRoot()
Returns the name of the SchemaElement which represents the
database used by the tables mapped to this mapping class element.
|
MappingFieldElement |
getField(String name)
Scans through this mapping class looking for a field whose
name matches the name passed in.
|
ArrayList |
getFields()
Returns the list of fields (MappingFieldElements) in this mapping
class.
|
MappingTableElement |
getTable(String name)
Scans through this mapping class looking for a table whose
name matches the name passed in.
|
ArrayList |
getTables()
Returns the list of tables (MappingTableElements) used by this mapping
class.
|
List |
getVersionFields()
Returns the list of version fields (MappingFieldElements) in this
mapping class.
|
int |
getVersionNumber()
Returns the version number of this MappingClassElement object.
|
boolean |
hasOldVersionNumber()
Returns true if the version number of this MappingClassElement object
is older than the current version number of the archiving scheme.
|
boolean |
isModified()
Gets the modified flag for this mapping class.
|
boolean |
isNavigable()
Gets the navigable flag for this mapping class.
|
void |
postUnarchive()
This method is called after a MappingClassElement is unarchived
from a .mapping file.
|
void |
preArchive()
This method is called prior to storing a MappingClassElement in a
.mapping file.
|
void |
removeField(MappingFieldElement field)
Removes a field from the list of fields in this mapping class.
|
void |
removeTable(MappingTableElement table)
Removes the reference to the supplied table as a mapped table for this
mapping class.
|
void |
setConsistencyLevel(int level)
Set the consistency level of this mapping class.
|
void |
setDatabaseRoot(org.netbeans.modules.dbschema.SchemaElement root)
Set the database root for this MappingClassElement.
|
void |
setModified(boolean flag)
Set the modified flag for this mapping class to flag.
|
void |
setNavigable(boolean flag)
Set the navigable flag for this mapping class to flag.
|
void |
setPrimaryTable(org.netbeans.modules.dbschema.TableElement table)
Set the primary table for this mapping class to the supplied table.
|
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
compareTo
static final String MAPPING_EXTENSION
static final int NONE_CONSISTENCY
static final int CHECK_MODIFIED_AT_COMMIT_CONSISTENCY
static final int CHECK_ALL_AT_COMMIT_CONSISTENCY
static final int LOCK_WHEN_MODIFIED_CONSISTENCY
static final int LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY
static final int LOCK_WHEN_LOADED_CONSISTENCY
static final int VERSION_CONSISTENCY
int getVersionNumber()
boolean hasOldVersionNumber()
getVersionNumber()
void postUnarchive() throws ModelException
ModelException
- if impossiblevoid preArchive() throws ModelException
ModelException
- if impossibleboolean isModified()
true
if there have been (property) changes to this
class, false
otherwise.void setModified(boolean flag)
true
by property changes and false
after a save.flag
- if true
, this class is marked as modified;
if false
, it is marked as unmodified.int getConsistencyLevel()
NONE_CONSISTENCY
,
CHECK_MODIFIED_AT_COMMIT_CONSISTENCY
,
CHECK_ALL_AT_COMMIT_CONSISTENCY
,
LOCK_WHEN_MODIFIED_CONSISTENCY
,
LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY
,
LOCK_WHEN_LOADED_CONSISTENCY
, or
VERSION_CONSISTENCY
.void setConsistencyLevel(int level) throws ModelException
level
- an integer indicating the consistency level, one of:
NONE_CONSISTENCY
,CHECK_MODIFIED_AT_COMMIT_CONSISTENCY
,
CHECK_ALL_AT_COMMIT_CONSISTENCY
,
LOCK_WHEN_MODIFIED_CONSISTENCY
,
LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY
,
LOCK_WHEN_LOADED_CONSISTENCY
, or
VERSION_CONSISTENCY
.ModelException
- if impossible.String getDatabaseRoot()
void setDatabaseRoot(org.netbeans.modules.dbschema.SchemaElement root) throws ModelException
root
- the new database rootModelException
- if impossibleArrayList getTables()
MappingTableElement getTable(String name)
name
- name of the table to find.void addTable(org.netbeans.modules.dbschema.TableElement table) throws ModelException
table
- table element to be added as either a primary or secondary
table.ModelException
- if impossiblevoid setPrimaryTable(org.netbeans.modules.dbschema.TableElement table) throws ModelException
table
- table element to be used as the primary table.ModelException
- if impossibleMappingReferenceKeyElement addSecondaryTable(MappingTableElement parentTable, org.netbeans.modules.dbschema.TableElement table) throws ModelException
parentTable
- mapping table element which should also be the primary
table.table
- table element to be used as a secondary table.ModelException
- if impossiblevoid removeTable(MappingTableElement table) throws ModelException
table
- mapping table element to be removed from this mapping class.ModelException
- if impossibleArrayList getFields()
MappingFieldElement getField(String name)
name
- name of the field to find.void addField(MappingFieldElement field) throws ModelException
field
- field element to be addedModelException
- if impossiblevoid removeField(MappingFieldElement field) throws ModelException
field
- field element to be removedModelException
- if impossibleList getVersionFields()
VERSION_CONSISTENCY
.boolean isNavigable()
true
if lazy initialization will be used,
false
if access to a non-fetched field will result in an
exception. The default is true
.void setNavigable(boolean flag) throws ModelException
flag
- if true
, lazy initialization will be used;
if false
, access to a non-fetched field will result in an
exception.ModelException
- if impossibleCopyright © 2020. All rights reserved.