Methods Summary |
---|
public void | addColumn(org.netbeans.modules.dbschema.DBMemberElement column)Adds a column to the list of columns mapped by this mapping field.
if (column != null)
{
ArrayList columns = getColumns();
String columnName = NameUtil.getRelativeMemberName(
column.getName().getFullName());
if (!columns.contains(columnName))
{
try
{
fireVetoableChange(PROP_COLUMNS, null, null);
columns.add(columnName);
firePropertyChange(PROP_COLUMNS, null, null);
// sync up runtime's object list too
_columnObjects = null;
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
}
else
{
// this part was blank -- do we want an error or skip here?
}
}
else
{
throw new ModelException(I18NHelper.getMessage(getMessages(),
"mapping.element.null_argument")); // NOI18N
}
|
public int | getCloneDepth() return (_properties & CLONE_MASK);
|
public java.util.ArrayList | getColumnObjects()Returns the list of columns (ColumnElements) to which this mapping
field is mapped. This method should only be used by the runtime.
//@olsen: compute objects on access
if (_columnObjects == null)
{
//@olsen: calculate the column objects based on
// the column names as stored in _columns
//_columnObjects = new ArrayList();
_columnObjects = MappingClassElementImpl.toColumnObjects(
getDeclaringClass().getDatabaseRoot(), getColumns());
}
return _columnObjects;
|
public java.util.ArrayList | getColumns()Returns the list of column names to which this mapping field is
mapped.
if (_columns == null)
_columns = new ArrayList();
return _columns;
|
public ConcurrencyGroupElement[] | getConcurrencyGroups()Returns the array of concurrency groups to which this field belongs.
return getPersistenceFieldElement().getConcurrencyGroups();
|
public int | getFetchGroup()Get the fetch group of this field element. return _fetchGroup;
|
public int | getFieldNumber()Computes the field number of this field element.
return getPersistenceFieldElement().getFieldNumber();
|
public boolean | getLogOnAccess() return getProperty(LOG_ON_ACCESS);
|
public boolean | getLogOnUpdate() return getProperty(LOG_ON_UPDATE);
|
public boolean | getModifyBeforeImageOnUpdate()
return getProperty(MOD_BI_ON_UPDATE);
|
public boolean | getObserveOnAccess()
return getProperty(OBSERVE_ON_ACCESS);
|
final PersistenceFieldElement | getPersistenceFieldElement()
return ((MappingClassElementImpl)getDeclaringClass()).
getPersistenceElement().getField(getName());
|
public int | getProperties() return _properties;
|
private boolean | getProperty(int propertyBit)
return ((getProperties() & propertyBit) > 0);
|
public boolean | getRecordOnUpdate()
return getProperty(RECORD_ON_UPDATE);
|
public boolean | getReferentialIntegrityUpdates()
return getProperty(REF_INTEGRITY_UPDATES);
|
public boolean | getSendBeforeImage()
return getProperty(SEND_BEFORE_IMAGE);
|
public boolean | isInConcurrencyCheck()Determines whether this field element is in a concurrency check or not.
return getProperty(IN_CONCURRENCY_CHECK);
|
protected boolean | isMappedToTable(MappingTableElement table)
String tableName = table.getName();
Iterator iterator = getColumns().iterator();
while (iterator.hasNext())
{
String columnName = iterator.next().toString();
if (NameUtil.getTableName(columnName).equals(tableName))
return true;
}
return false;
|
public boolean | isReadOnly()Determines whether this field element is read only or not. return getProperty(READ_ONLY);
|
public boolean | isVersion()Determines whether this field element is a version field or not. return _isVersion;
|
public void | removeColumn(java.lang.String columnName)Removes a column from the list of columns mapped by this mapping field.
This method overrides the one in MappingFieldElement to
remove the argument from the associated columns if necessary.
if (columnName != null)
{
try
{
fireVetoableChange(PROP_COLUMNS, null, null);
if (!getColumns().remove(columnName))
{
throw new ModelException(
I18NHelper.getMessage(getMessages(),
"mapping.element.element_not_removed", // NOI18N
columnName));
}
firePropertyChange(PROP_COLUMNS, null, null);
// sync up runtime's object list too
_columnObjects = null;
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
}
|
public void | setCloneDepth(int cloneDepth)
if (cloneDepth < CLONE_FIELD || cloneDepth > CLONE_DEEP)
{
}
_properties = _properties & ~CLONE_MASK | cloneDepth;
|
public void | setFetchGroup(int group)Set the fetch group of this field element.
Integer old = new Integer(getFetchGroup());
Integer newGroup = new Integer(group);
try
{
fireVetoableChange(PROP_FETCH_GROUP, old, newGroup);
setFetchGroupInternal(group);
firePropertyChange(PROP_FETCH_GROUP, old, newGroup);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
protected void | setFetchGroupInternal(int group)Set the fetch group of this field element. Meant to be used in the
constructor and by subclasses when there should be no exceptions and
no property change events fired.
_fetchGroup = group;
|
public void | setInConcurrencyCheck(boolean flag)Set whether this field element is in a concurrency check or not.
Boolean old = JavaTypeHelper.valueOf(isInConcurrencyCheck());
Boolean newFlag = JavaTypeHelper.valueOf(flag);
try
{
fireVetoableChange(PROP_IN_CONCURRENCY_CHECK, old, newFlag);
setProperty(flag, IN_CONCURRENCY_CHECK);
firePropertyChange(PROP_IN_CONCURRENCY_CHECK, old, newFlag);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
public void | setLogOnAccess(boolean flag)
setProperty(flag, LOG_ON_ACCESS);
|
public void | setLogOnUpdate(boolean flag)
setProperty(flag, LOG_ON_UPDATE);
|
public void | setModifyBeforeImageOnUpdate(boolean flag)
setProperty(flag, MOD_BI_ON_UPDATE);
|
public void | setObserveOnAccess(boolean flag)
setProperty(flag, OBSERVE_ON_ACCESS);
|
public void | setProperty(boolean flag, int propertyBit)
_properties =
(flag) ? (_properties | propertyBit) : (_properties & ~propertyBit);
|
public void | setReadOnly(boolean flag)Set whether this field element is read only or not.
Boolean old = JavaTypeHelper.valueOf(isReadOnly());
Boolean newFlag = JavaTypeHelper.valueOf(flag);
try
{
fireVetoableChange(PROP_READ_ONLY, old, newFlag);
setProperty(flag, READ_ONLY);
firePropertyChange(PROP_READ_ONLY, old, newFlag);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
public void | setRecordOnUpdate(boolean flag)
setProperty(flag, RECORD_ON_UPDATE);
|
public void | setReferentialIntegrityUpdates(boolean flag)
setProperty(flag, REF_INTEGRITY_UPDATES);
|
public void | setSendBeforeImage(boolean flag)
setProperty(flag, SEND_BEFORE_IMAGE);
|
public void | setVersion(boolean flag)Set whether this field element is a version field or not.
Boolean old = JavaTypeHelper.valueOf(isVersion());
Boolean newFlag = JavaTypeHelper.valueOf(flag);
try
{
fireVetoableChange(PROP_VERSION_FIELD, old, newFlag);
_isVersion = flag;
firePropertyChange(PROP_VERSION_FIELD, old, newFlag);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
protected void | stripSchemaName()Boston to Pilsen conversion.
This method converts the absolute column names to relative names.
if (_columns != null) // handle _columns
{
// Use ListIterator here, because I want to replace the value
// stored in the ArrayList. The ListIterator returned by
// ArrayList.listIterator() supports the set method.
ListIterator i = _columns.listIterator();
while (i.hasNext())
i.set(NameUtil.getRelativeMemberName((String)i.next()));
}
|