Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.Surrogate


        Database database = parent.getSurrogate().getDatabase();
        while (rs.next()) {
          int id = rs.getInt(1);
          if (id == 0)
            throw T2DBMsg.exception(E.E40105, parent == null ? null : parent.toString(), rs.getString(3));
          Surrogate surrogate = makeSurrogate(database, DBObjectType.CHRONICLE, id);
          RawData data = new ChronicleImpl.RawData();
          data.setSurrogate(surrogate);
          int schema = rs.getInt(2);
          data.setCollection(parent);
          data.setSchema(schema == 0 ? null : makeSurrogate(database, DBObjectType.SCHEMA, schema));
View Full Code Here


        sel_attibute_prop_in_ent[0] = close(sel_attibute_prop_in_ent[0]);
      else if (size > 0)
        sel_attibute_prop_in_ent[size] = close(sel_attibute_prop_in_ent[size]);
    }
    if (found > 0) {
      Surrogate s = makeSurrogate(db, DBObjectType.CHRONICLE, found);
      check(Permission.READ, s);
    }
    return found > 0;
  }
View Full Code Here

      sel_entities_by_attribute = open(SEL_ENTITIES_BY_ATTRIBUTE, property, sel_entities_by_attribute);
      sel_entities_by_attribute.setString(1, stringValue);
      sel_entities_by_attribute.setInt(2, getId(property));
      ResultSet rs = sel_entities_by_attribute.executeQuery();
      while (rs.next()) {
        Surrogate surrogate = makeSurrogate(property.getSurrogate().getDatabase(), DBObjectType.CHRONICLE, rs.getInt(1));
        Chronicle chronicle = new ChronicleImpl(surrogate);
        check(Permission.READ, chronicle);
        chronicles.add(chronicle);
        if (maxSize > 0 && chronicles.size() >= maxSize)
          break;
View Full Code Here

   *
   * @param vt a value type
   * @throws T2DBException
   */
  public void createValueType(ValueType<?> vt) throws T2DBException {
    Surrogate surrogate = null;
    Throwable cause = null;
    try {
      check(Permission.CREATE, vt);
      create_valuetype = open(CREATE_VALUETYPE, vt, create_valuetype);
      create_valuetype.setString(1, vt.getName());
View Full Code Here

    try {
      select_property_by_name = open(SELECT_PROPERTY_BY_NAME, database, select_property_by_name);
      select_property_by_name.setString(1, name);
      ResultSet rs = select_property_by_name.executeQuery();
      if (rs.next()) {
        Surrogate surrogate = makeSurrogate(database, DBObjectType.PROPERTY, rs.getInt(1));
        return getProperty(surrogate, rs.getString(3), rs.getInt(2));
      } else
        return null;
    } catch (Exception e) {
      throw T2DBJMsg.exception(e, J.J20104, name);
View Full Code Here

    try {
      select_property_by_pattern = open(SELECT_PROPERTY_BY_PATTERN, database, select_property_by_pattern);
      select_property_by_pattern.setString(1, pattern);
      ResultSet rs = select_property_by_pattern.executeQuery();
      while(rs.next()) {
        Surrogate surrogate = makeSurrogate(database, DBObjectType.PROPERTY, rs.getInt(1));
        result.add(getProperty(surrogate, rs.getString(3), rs.getInt(2)));
      }
      return result;
    } catch (Exception e) {
      throw T2DBJMsg.exception(e, J.J20106, pattern);
View Full Code Here

    }
  }
 
  @SuppressWarnings({ "unchecked", "rawtypes" })
  private <T>Property<?> getProperty(Surrogate surrogate, String name, int valueTypeId) throws T2DBException, SQLException {
    Surrogate vtKey = makeSurrogate(surrogate.getDatabase(), DBObjectType.VALUE_TYPE, valueTypeId);
    ValueType<?> vt = getVTRMethods(surrogate).getValueType(vtKey);
    return new PropertyImpl(name, vt, true, surrogate);
  }
View Full Code Here

      ResultSet rs = select_entity_by_parent_and_name.executeQuery();
      if (rs.next()) {
        int id = rs.getInt(1);
        if (id == 0)
          throw T2DBJMsg.exception(J.J40105, parent == null ? null : parent.toString(), name);
        Surrogate surrogate = makeSurrogate(parent.getSurrogate().getDatabase(), DBObjectType.CHRONICLE, id);
        ChronicleImpl.RawData data = new ChronicleImpl.RawData();
        data.setSurrogate(surrogate);
        int schema = rs.getInt(2);
        data.setCollection(parent);
        data.setSchema(schema == 0 ? null : makeSurrogate(parent.getSurrogate().getDatabase(), DBObjectType.SCHEMA, schema));
View Full Code Here

        Database database = parent.getSurrogate().getDatabase();
        while (rs.next()) {
          int id = rs.getInt(1);
          if (id == 0)
            throw T2DBJMsg.exception(J.J40105, parent == null ? null : parent.toString(), rs.getString(3));
          Surrogate surrogate = makeSurrogate(database, DBObjectType.CHRONICLE, id);
          RawData data = new ChronicleImpl.RawData();
          data.setSurrogate(surrogate);
          int schema = rs.getInt(2);
          data.setCollection(parent);
          data.setSchema(schema == 0 ? null : makeSurrogate(database, DBObjectType.SCHEMA, schema));
View Full Code Here

      sel_entities_by_attribute = open(SEL_ENTITIES_BY_ATTRIBUTE, property, sel_entities_by_attribute);
      sel_entities_by_attribute.setString(1, stringValue);
      sel_entities_by_attribute.setInt(2, getId(property));
      ResultSet rs = sel_entities_by_attribute.executeQuery();
      while (rs.next()) {
        Surrogate surrogate = makeSurrogate(property.getSurrogate().getDatabase(), DBObjectType.CHRONICLE, rs.getInt(1));
        Chronicle chronicle = new ChronicleImpl(surrogate);
        check(Permission.READ, chronicle);
        chronicles.add(chronicle);
        if (maxSize > 0 && chronicles.size() >= maxSize)
          break;
View Full Code Here

TOP

Related Classes of ch.agent.crnickl.api.Surrogate

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.