Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoIdentity


    }

    // ---------------------------------------------------------------------
    // Parse the attribute information for retrieving mapping information
    if (c.getAnnotation(IdClass.class) != null) {
      sc.identity = new SpeedoIdentity();
      sc.identity.objectidJClass = ((IdClass) c.getAnnotation(IdClass.class)).value();
      sc.identity.objectidClass = sc.identity.objectidJClass.getName();
      sc.identity.strategy = SpeedoIdentity.USER_ID;
      parsePkClass(sc);
    }
View Full Code Here


      logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
          + ": try to define field (" + sf.name
          + ") as an Id - an Id already exist.");
      return false;
    }
    sc.identity = new SpeedoIdentity();
    sc.identity.objectidClass = null;
    sf.primaryKey = true;
    logger.log(BasicLevel.DEBUG, sc.getSourceDescShort()
        + ": define field (" + sf.name
        + ") as an Id - strategy = " + sc.identity.getStrategyName() + ".");
View Full Code Here

          + ": try to define field (" + sf.name
          + ") as an EmbeededId - an Id already exist.");
      return;
    }
    try {
      sc.identity = new SpeedoIdentity();
      sc.identity.objectidClass = sf.getClassName();
      sc.identity.objectidJClass = Class.forName(
          Type.getType(sf.type).getClassName(), false, annotCL);
      sc.identity.strategy = SpeedoIdentity.USER_ID;
      if (parsePkClass(sc)) {
View Full Code Here

    SpeedoClass ancestor = (SpeedoClass) family.get(0);
    List extensions = findExtensions(ancestor, new String[] {
      ID, SQL_SEQ_ALLOCATOR, SQL_SEQ_CACHE, SQL_SEQ_INC, SQL_SEQ_NAME,
      SQL_SEQ_START});
    boolean detachable = ancestor.isDetachable;
    SpeedoIdentity currentIdentity = ancestor.identity;
    for(int i=1; i<family.size(); i++) {
      SpeedoClass anAncestor = (SpeedoClass) family.get(i);
      SpeedoNoFieldColumn[] cols = null;
      if (anAncestor.identity != null) {
          cols = anAncestor.identity.columns;
View Full Code Here

    } else if (se instanceof SpeedoClass) {
      SpeedoClass sc = (SpeedoClass) se;
      //sc.enhancementStatus = ?;
      sc.fetchGroups = new HashMap();
      sc.fields = new HashMap();
      sc.identity = new SpeedoIdentity();
      sc.versionField = null;
      sc.inheritance = null;
      sc.isAbstract = false;
      sc.isDetachable = false;
      sc.isInstanceCallbacks = false;
      sc.isSerializable = false;
      //sc.jdoExtension = ?;
      //sc.joinToExtTables = ?;
      //sc.jormclass = ?;
      sc.callBacks = null;
      //sc.mainTable = ?;
      //sc.moPackage = ?;
      //sc.name = ?;
      sc.name2query = new HashMap();
      //sc.noArgConstructorStatus = ?;
      //sc.version = ?;
    } else if (se instanceof SpeedoField) {
      SpeedoField sf = (SpeedoField) se;
      sf.name = null;
      //sf.visibility = ?;
      sf.propagate = SpeedoField.PROPAG_ALL;
      sf.type = null;
      sf.number = -1;
      sf.persistenceStatus = SpeedoField.UNKNOWN;
      sf.primaryKey = false;
      sf.nullValue = SpeedoNullValue.NONE;
      sf.defaultFetchGroup = true;
      sf.depth = 0;
      //sf.fetchGroup = ?;
      sf.embedded = true;
      //sf.valueStrategy = ?;
      //sf.sequence = ?;
      sf.relationType = SpeedoField.NO_BI_RELATION;
      sf.reverseField = null;
      sf.isCoherentReverseField = false;
      sf.jdoTuple = null;
      sf.moClass = null;
      if (sf.columns != null) {
          System.out.println("forget existing columns");
          throw new RuntimeException("forget existing columns");
      }
      sf.columns = null;
      sf.join = null;
      sf.mappedByReversefield = false;
    } else if (se instanceof SpeedoTable) {
      SpeedoTable st = (SpeedoTable) se;
      st.catalog = null;
      st.name = null;
      st.schema = null;
      st.join = null;
    } else if (se instanceof SpeedoJoin) {
      SpeedoJoin sj = (SpeedoJoin) se;
      sj.extTable = null;
      sj.mainTable = null;
      sj.columns = new ArrayList();
      sj.deleteAction = SpeedoJoin.ACTION_NONE;
    } else if (se instanceof SpeedoColumn) {
      SpeedoColumn sc = (SpeedoColumn) se;
      sc.allowNull = true;
      sc.defaultValue = null;
      sc.jdbcType = null;
      sc.length = -1;
      sc.name = null;
      sc.targetColumn = null;
      sc.targetField = null;
      sc.scale = -1;
      sc.sqlType = null;
      sc.table = null;
      sc.insertable = true;
      sc.updatable = true;
    } else if (se instanceof SpeedoIdentity) {
      SpeedoIdentity si = (SpeedoIdentity) se;
      si.objectidClass = null;
      si.objectidJClass = null;
      si.sequenceName = null;
      si.strategy = SpeedoIdentity.DATASTORE_LONG;
      si.columns = null;
View Full Code Here

      //sc.sqlType = ?;
      sc.table = null;
      sc.insertable = true;
      sc.updatable = true;
    } else if (se instanceof SpeedoIdentity) {
      SpeedoIdentity si = (SpeedoIdentity) se;
      si.objectidClass = null;
      si.objectidJClass = null;
      si.sequenceName = null;
      si.strategy = SpeedoIdentity.NO_ID;
      si.columns = null;
View Full Code Here

        //TODO: unmanaged stuff of class
        unmanaged(null, new String[]{"foreign-key", "unique"},
                classNode,  classChildren);
    }
    private void treatDataStoreId(Node dsiNode, SpeedoClass moClass) throws SpeedoException {
        SpeedoIdentity ident = new SpeedoIdentity(); //default strategy is native
        //<!ATTLIST datastore-identity strategy CDATA 'native'>
        Node n = dsiNode.getAttributes().getNamedItem("strategy");
        if (n == null)
            throw new SpeedoXMLError("Attribute strategy for tag datastore-identity requested.");
        ident.strategy = SpeedoIdentity.getStrategy(n.getNodeValue());
View Full Code Here

        );
        ((SpeedoPackage) mo).addClass(c, true, logger);
        return c;
    }
    private Object treatDataStoreId(Node node, Object mo) throws SpeedoException {
        SpeedoIdentity ident = new SpeedoIdentity(); //default strategy is native
        //attribute strategy
        Node n = node.getAttributes().getNamedItem("strategy");
        if (n == null)
            throw new SpeedoXMLError("Attribute strategy for tag datastore-identity requested.");
        ident.strategy = SpeedoIdentity.getStrategy(n.getNodeValue());
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.metadata.SpeedoIdentity

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.