throw ExceptionUtil.createException(data,null,"orm setting autogenmap=false is not supported yet",null);
// load entities
if(!ArrayUtil.isEmpty(data.tmpList)) {
data.getNamingStrategy();// caled here to make sure, it is called in the right context the first one
DatasourceConnection dc = CommonUtil.getDatasourceConnection(pc, ds);
try {
Iterator<Component> it = data.tmpList.iterator();
while(it.hasNext()){
createMapping(pc,it.next(),dc,ormConf,data);
}
}
finally {
CommonUtil.releaseDatasourceConnection(pc, dc);
}
if(data.tmpList.size()!=data.cfcs.size()){
Component cfc;
String name,lcName;
Map<String,String> names=new HashMap<String,String>();
Iterator<Component> it = data.tmpList.iterator();
while(it.hasNext()){
cfc=it.next();
name=HibernateCaster.getEntityName(cfc);
lcName=name.toLowerCase();
if(names.containsKey(lcName))
throw ExceptionUtil.createException(data,null,"Entity Name ["+name+"] is ambigous, ["+names.get(lcName)+"] and ["+cfc.getPageSource().getDisplayPath()+"] use the same entity name.","");
names.put(lcName,cfc.getPageSource().getDisplayPath());
}
}
}
}
}
}
finally {
data.tmpList=null;
}
// already initialized for this application context
if(data.getConfiguration()!=null) return data;
//MUST
//cacheconfig
//cacheprovider
//...
String mappings=HibernateSessionFactory.createMappings(ormConf,data);
DatasourceConnection dc = CommonUtil.getDatasourceConnection(pc,ds);
try{
data.setConfiguration(mappings,dc);
}
catch (Exception e) {
throw CommonUtil.toPageException(e);