abstract static class CollectionType {
private String xmlTag;
public abstract Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException;
CollectionType(String xmlTag) {
this.xmlTag = xmlTag;
}
public String toString() {
return xmlTag;
}
private static final CollectionType MAP = new CollectionType( "map" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
Map map = new Map( owner );
bindCollection( node, map, owner.getEntityName(), path, mappings, inheritedMetas );
return map;
}
};
private static final CollectionType SET = new CollectionType( "set" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
Set set = new Set( owner );
bindCollection( node, set, owner.getEntityName(), path, mappings, inheritedMetas );
return set;
}
};