Package de.mhus.lib.adb.model

Examples of de.mhus.lib.adb.model.Table


      } catch (Throwable t) {
        throw new MException(t);
      }
    }
   
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      Object out = c.getObject(con,keys);
     
      if (myCon != null) {
        try {
          myCon.commit();
        } catch (Throwable t) {
View Full Code Here


      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName(),registryName);
      registryName = clazz.getCanonicalName();
    }

    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      if (object == null) {
       
        object = schema.createObject(c.getClazz(), registryName, res, this);
      }
      c.fillObject(object,con,res);
     
      schema.doPostLoad(c,object,con, this);
     
    } catch (Throwable t) {
      throw new MException(registryName,t);
View Full Code Here

      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName(),registryName);
      registryName = clazz.getCanonicalName();
    }

    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);

    LinkedList<Object> keys = new LinkedList<Object>();
    try {
      for (Field f : c.getPrimaryKeys()) {
        keys.add(f.getFromTarget(object));
      }
     
      if (c.fillObject(con,object,keys.toArray()) == null)
        throw new MException("object not found");
     
      schema.doPostLoad(c,object,con,this);
     
    } catch (Throwable t) {
View Full Code Here

      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName(),registryName);
      registryName = clazz.getCanonicalName();
    }

    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);

    boolean ret = false;
    LinkedList<Object> keys = new LinkedList<Object>();
    try {
      for (Field f : c.getPrimaryKeys()) {
        keys.add(f.getFromTarget(object));
      }
     
      ret = c.objectChanged(con,object,keys.toArray());
     
      // schema.doPostLoad(c,object,con,this);
     
    } catch (Throwable t) {
      throw new MException(registryName,t);
View Full Code Here

      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName(),registryName);
      registryName = clazz.getCanonicalName();
    }

    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      c.fillObject(con,object,keys);
     
      schema.doPostLoad(c,object,con,this);
     
    } catch (Throwable t) {
      throw new MException(registryName,t);
View Full Code Here

      Class<?> clazz = schema.findClassForObject(object,this);
      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName(),registryName);
      registryName = clazz.getCanonicalName();
    }
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      // prepare object
      c.prepareCreate(object);
      schema.doPreCreate(c,object,con,this);
     
      //save object
   
      c.createObject(con,object);
     
      schema.doPostLoad(c,object,con,this);

    } catch (Throwable t) {
      throw new MException(registryName,t);
View Full Code Here

      Class<?> clazz = schema.findClassForObject(object,this);
      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName());
      registryName = clazz.getCanonicalName();
    }
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      // prepare object
      schema.doPreSave(c,object,con,this);
     
      //save object
      c.saveObject(con,object);
    } catch (Throwable t) {
      throw new MException(registryName,t);
    }
   
    if (myCon != null) {
View Full Code Here

      Class<?> clazz = schema.findClassForObject(object,this);
      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName());
      registryName = clazz.getCanonicalName();
    }
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      // prepare object
      schema.doPreRemove(c,object,con,this);
     
      //save object
      c.removeObject(con,object);
     
      schema.doPostRemove(c,object,con,this);

    } catch (Throwable t) {
      throw new MException(registryName,t);
View Full Code Here

    }
   
  }
 
  protected void addClass(String tableName, String registryName, Class<?> clazz, DbConnection con) throws Exception {
    Table c = schema.createTable(this,clazz,registryName,tableName);
    c.initDatabase(con);
//    c.registryName = registryName;
//    parseClass(c,tableName);
//    c.createTable(con);
//    c.postInit();
    cIndex.put(registryName,c);
View Full Code Here

  public Table getTable(String registryName) {
    return cIndex.get(registryName);
  }
 
  public Object createSchemaObject(String registryName) throws Exception {
    Table table = cIndex.get(registryName);
    if (table == null) throw new MException("class definition not found in schema",registryName);
    return schema.createObject(table.getClazz(), table.getRegistryName(), null, this);
  }
View Full Code Here

TOP

Related Classes of de.mhus.lib.adb.model.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.