Esempio n. 1
0
 private Entity getEntity(String entityName, Model model) {
   EList<Package> packages = model.getPackages();
   for (Package pkg : packages) {
     for (Entity entity : pkg.getEntities()) {}
   }
   return null;
 }
Esempio n. 2
0
 private Entity searchEntity(Model model, String enitityName) {
   for (Package pkg : model.getPackages()) {
     for (Entity entity : pkg.getEntities()) {
       if (entity.getName().equals(enitityName)) return entity;
     }
   }
   throw new RuntimeException("No entity found with name " + enitityName);
 }
Esempio n. 3
0
 public List<String> idObjectsMDClasses(Model model) {
   EList<Package> packages = model.getPackages();
   List<String> result = new ArrayList<String>();
   for (Package pkg : packages) {
     for (Entity entity : pkg.getEntities()) {
       result.add(entity.getName() + "MD");
     }
   }
   return result;
 }
Esempio n. 4
0
 public String modelMDPackageName(Model model) {
   String modelName = model.getName();
   int ix = modelName.lastIndexOf(".");
   if (ix == -1) return modelName;
   return modelName.substring(0, ix);
 }
Esempio n. 5
0
 public String modelMDClassName(Model model) {
   String modelName = model.getName();
   int ix = modelName.lastIndexOf(".");
   if (ix == -1) return modelName;
   return modelName.substring(ix + 1) + "MD";
 }
Esempio n. 6
0
 public String modelMDFileName(Model model) {
   String modelName = model.getName();
   String modelMDFileName = modelName.replace(".", File.separator);
   return modelMDFileName + "MD.java";
 }