el, mappings);
// joined subclasses
if ( model.getClassPersisterClass()==null ) {
model.getRootClass().setClassPersisterClass(NormalizedEntityPersister.class);
}
// table + schema names
Attribute schemaNode = node.attribute("schema");
String schema = schemaNode==null ? mappings.getSchemaName() : schemaNode.getValue();
Table mytable = mappings.addTable( schema, getClassTableName(model, node, mappings) );
model.setTable(mytable);
log.info("Mapping joined-subclass: " + model.getName() + " -> " + model.getTable().getName() );
Element keyNode = node.element("key");
SimpleValue key = new SimpleValue(mytable);
model.setKey(key);
bindSimpleValue(keyNode, key, false, model.getName(), mappings);
model.getKey().setType( model.getIdentifier().getType() );
model.createPrimaryKey();
model.createForeignKey();
//CHECK
Attribute chNode = node.attribute("check");
if (chNode!=null) mytable.addCheckConstraint( chNode.getValue() );
// properties
propertiesFromXML(node, model, mappings);
}
public static void bindRootClass(Element node, RootClass model, Mappings mappings) throws MappingException {
bindClass(node, model, mappings);
//TABLENAME
Attribute schemaNode = node.attribute("schema");
String schema = schemaNode==null ? mappings.getSchemaName() : schemaNode.getValue();
Table table = mappings.addTable( schema, getClassTableName(model, node, mappings) );
model.setTable(table);
log.info("Mapping class: " + model.getName() + " -> " + model.getTable().getName() );
//MUTABLE
Attribute mutableNode = node.attribute("mutable");
model.setMutable( (mutableNode==null) || mutableNode.getValue().equals("true") );
//WHERE
Attribute whereNode = node.attribute("where");
if (whereNode!=null) model.setWhere( where
上一篇:
BindActionForm.java
下一篇:
按摩连锁财务管理系统|按摩连锁财务管理系统第一版