Package ch.agent.crnickl.impl

Examples of ch.agent.crnickl.impl.AttributeDefinitionImpl


  private Collection<AttributeDefinition<?>> makeAttributeDefinitions(Database database, Collection<RawSchemaComponent> allAttr) throws T2DBException {
    Collection<AttributeDefinition<?>> defs = new ArrayList<AttributeDefinition<?>>();
    for (RawSchemaComponent oneAttr : allAttr) {
      AttributeDefinitionImpl<?> def = null;
      if (oneAttr.propId < 1) {
        def = new AttributeDefinitionImpl(oneAttr.seriesNr, oneAttr.attribNr, null, null);
        def.edit();
        def.setErasing(true);
      } else {
        Property<?> property = ((JDBCDatabase)database).getReadMethodsForProperty()
          .getProperty(makeSurrogate(database, DBObjectType.PROPERTY, oneAttr.propId));
        def = new AttributeDefinitionImpl(oneAttr.seriesNr, oneAttr.attribNr, property, property.getValueType().scan(oneAttr.value));
      }
      defs.add(def);
    }
    return defs;
  }
View Full Code Here


  private Collection<AttributeDefinition<?>> makeAttributeDefinitions(Database database, Collection<RawSchemaComponent> allAttr) throws T2DBException {
    Collection<AttributeDefinition<?>> defs = new ArrayList<AttributeDefinition<?>>();
    for (RawSchemaComponent oneAttr : allAttr) {
      AttributeDefinitionImpl<?> def = null;
      if (oneAttr.propId < 1) {
        def = new AttributeDefinitionImpl(oneAttr.attribNr, null, null);
        def.edit();
        def.setErasing(true);
      } else {
        Property<?> property = ((JDBCDatabase)database).getReadMethodsForProperty()
          .getProperty(makeSurrogate(database, DBObjectType.PROPERTY, oneAttr.propId));
        def = new AttributeDefinitionImpl(oneAttr.attribNr, property, property.getValueType().scan(oneAttr.value));
      }
      defs.add(def);
    }
    return defs;
  }
View Full Code Here

  private Collection<AttributeDefinition<?>> makeAttributeDefinitions(Database database, Collection<RawSchemaComponent> allAttr) throws T2DBException {
    Collection<AttributeDefinition<?>> defs = new ArrayList<AttributeDefinition<?>>();
    for (RawSchemaComponent oneAttr : allAttr) {
      AttributeDefinitionImpl<?> def = null;
      if (oneAttr.propId < 1) {
        def = new AttributeDefinitionImpl(oneAttr.seriesNr, oneAttr.attribNr, null, null);
        def.edit();
        def.setErasing(true);
      } else {
        Property<?> property = ((JDBCDatabase)database).getReadMethodsForProperty()
          .getProperty(makeSurrogate(database, DBObjectType.PROPERTY, oneAttr.propId));
        def = new AttributeDefinitionImpl(oneAttr.seriesNr, oneAttr.attribNr, property, property.getValueType().scan(oneAttr.value));
      }
      defs.add(def);
    }
    return defs;
  }
View Full Code Here

  private AttributeDefinition<?> attributeDefinition(Surrogate schemaSurrogate, int seriesNr, Database db, BasicDBObject bo) throws T2DBException {
    int number = bo.getInt(MongoDatabase.FLD_ATTRIBDEF_NUM);
    boolean era = bo.getBoolean(MongoDatabase.FLD_ATTRIBDEF_ERASING);
    AttributeDefinitionImpl<?> def = null;
    if (era) {
      def = new AttributeDefinitionImpl(seriesNr, number, null, null);
      def.edit();
      def.setErasing(true);
    } else {
      ObjectId propId =  bo.getObjectId(MongoDatabase.FLD_ATTRIBDEF_PROP);
      Surrogate propSurr = makeSurrogate(db, DBObjectType.PROPERTY, new MongoDBObjectId(propId));
      Property<?> prop = ((MongoDatabase) db).getReadMethodsForProperty().getProperty(propSurr);
      String val =  bo.getString(MongoDatabase.FLD_ATTRIBDEF_VAL);
      checkIntegrity(prop, propSurr, schemaSurrogate);
      def = new AttributeDefinitionImpl(seriesNr, number, prop, prop.getValueType().scan(val));
    }
    return def;
  }
View Full Code Here

TOP

Related Classes of ch.agent.crnickl.impl.AttributeDefinitionImpl

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.