" -> " + collection.getCollectionTable().getName()
);
}
// CHECK
Attribute chNode = node.attribute( "check" );
if ( chNode != null ) {
collection.getCollectionTable().addCheckConstraint( chNode.getValue() );
}
// contained elements:
Iterator iter = node.elementIterator();
while ( iter.hasNext() ) {
Element subnode = (Element) iter.next();
String name = subnode.getName();
if ( "key".equals( name ) ) {
KeyValue keyVal;
String propRef = collection.getReferencedPropertyName();
if ( propRef == null ) {
keyVal = collection.getOwner().getIdentifier();
}
else {
keyVal = (KeyValue) collection.getOwner().getRecursiveProperty( propRef ).getValue();
}
SimpleValue key = new DependantValue( collection.getCollectionTable(), keyVal );
key.setCascadeDeleteEnabled( "cascade"
.equals( subnode.attributeValue( "on-delete" ) ) );
bindSimpleValue(
subnode,
key,
collection.isOneToMany(),
Collection.DEFAULT_KEY_COLUMN_NAME,
mappings
);
collection.setKey( key );
Attribute notNull = subnode.attribute( "not-null" );
( (DependantValue) key ).setNullable( notNull == null
|| notNull.getValue().equals( "false" ) );
Attribute updateable = subnode.attribute( "update" );
( (DependantValue) key ).setUpdateable( updateable == null
|| updateable.getValue().equals( "true" ) );
}
else if ( "element".equals( name ) ) {
SimpleValue elt = new SimpleValue( collection.getCollectionTable() );
collection.setElement( elt );