use of com.sun.jdo.api.persistence.model.ModelException in project Payara by payara.
the class MappingTableElementImpl method removeKeyColumn.
/**
* Removes a column from the primary key of columns in this mapping table.
* This method should only be used to manipulate the key columns of the
* primary table. The secondary table key columns should be manipulated
* using MappingReferenceKeyElement methods for pairs.
* @param columnName the relative name of the column to be removed
* @exception ModelException if impossible
*/
public void removeKeyColumn(String columnName) throws ModelException {
if (columnName != null) {
try {
fireVetoableChange(PROP_KEY_COLUMNS, null, null);
if (!getKey().remove(columnName)) {
throw new ModelException(I18NHelper.getMessage(getMessages(), // NOI18N
"mapping.element.element_not_removed", columnName));
}
firePropertyChange(PROP_KEY_COLUMNS, null, null);
// sync up runtime's object list too
// @olsen: rather clear objects instead of maintaining them
// getKeyObjects().remove(column);
_keyObjects = null;
} catch (PropertyVetoException e) {
throw new ModelVetoException(e);
}
}
}
Aggregations