Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.Chronicle


      String name = chronicle.getName(false);
      ((DatabaseBackend)chronicle.getSurrogate().getDatabase()).getNamingPolicy().checkSimpleName(name, false); // redundant but bugs exist
      String description = chronicle.getDescription(false);
      if (description == null)
        description = "";
      Chronicle collection = chronicle.getCollection();
      Schema schema = chronicle.getSchema(false);
      if (collection != null) {
        check(Permission.MODIFY, collection);
        if (schema != null && schema.equals(collection.getSchema(true)))
          schema = null; // don't repeat yourself
      }
      if (schema != null)
        check(Permission.READ, schema);
      create_entity = open(CREATE_ENTITY, chronicle, create_entity);
View Full Code Here


   * @throws T2DBException
   */
  public void createSeries(Series<?> series) throws T2DBException {
    Throwable cause = null;
    Surrogate surrogate = null;
    Chronicle chronicle = series.getChronicle();
    try {
      check(Permission.MODIFY, chronicle, true);
      create_series = open(CREATE_SERIES, series, create_series);
      create_series.setInt(1, getId(chronicle));
      create_series.setInt(2, series.getNumber());
View Full Code Here

   * @param surrogate a surrogate
   * @return a chronicle, never null
   * @throws T2DBException
   */
  public Chronicle getChronicle(Surrogate surrogate) throws T2DBException {
    Chronicle chronicle = null;
    Throwable cause = null;
    try {
      select_entity_by_id = open(SELECT_ENTITY_BY_ID, surrogate, select_entity_by_id);

      select_entity_by_id.setInt(1, getId(surrogate));
View Full Code Here

   * @param name a string
   * @return a chronicle or null
   * @throws T2DBException
   */
  public Chronicle getChronicleOrNull(Chronicle parent, String name) throws T2DBException {
    Chronicle chronicle = null;
    try {
      select_entity_by_parent_and_name = open(SELECT_ENTITY_BY_PARENT_AND_NAME, parent, select_entity_by_parent_and_name);
      select_entity_by_parent_and_name.setInt(1, getIdOrZero(parent));
      select_entity_by_parent_and_name.setString(2, name);
      ResultSet rs = select_entity_by_parent_and_name.executeQuery();
View Full Code Here

          int schema = rs.getInt(2);
          data.setCollection(parent);
          data.setSchema(schema == 0 ? null : makeSurrogate(database, DBObjectType.SCHEMA, schema));
          data.setName(rs.getString(3));
          data.setDescription(rs.getString(4));
          Chronicle chronicle = new ChronicleImpl(data);
          check(Permission.READ, chronicle);
          result.add(chronicle);
        }
        rs.close();
      } catch (SQLException e) {
View Full Code Here

      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

      select_series_by_id = open(SELECT_SERIES_BY_ID, surrogate, select_series_by_id);
      int id = getId(surrogate);
      select_series_by_id.setInt(1, id);
      ResultSet rs = select_series_by_id.executeQuery();
      if (rs.next()) {
        Chronicle chronicle = new ChronicleImpl(makeSurrogate(surrogate.getDatabase(), DBObjectType.CHRONICLE, rs.getInt(1)));
        return new SeriesImpl<T>(chronicle, null, rs.getInt(2), surrogate);
      } else
        return null;
    } catch (SQLException e) {
      throw T2DBMsg.exception(e, E.E50119, surrogate.toString());
View Full Code Here

   * @param surrogate a surrogate
   * @return a chronicle, never null
   * @throws T2DBException
   */
  public Chronicle getChronicle(Surrogate surrogate) throws T2DBException {
    Chronicle chronicle = null;
    Throwable cause = null;
    try {
      select_entity_by_id = open(SELECT_ENTITY_BY_ID, surrogate, select_entity_by_id);

      select_entity_by_id.setInt(1, getId(surrogate));
View Full Code Here

   * @param name a string
   * @return a chronicle or null
   * @throws T2DBException
   */
  public Chronicle getChronicleOrNull(Chronicle parent, String name) throws T2DBException {
    Chronicle chronicle = null;
    try {
      select_entity_by_parent_and_name = open(SELECT_ENTITY_BY_PARENT_AND_NAME, parent, select_entity_by_parent_and_name);
      select_entity_by_parent_and_name.setInt(1, getIdOrZero(parent));
      select_entity_by_parent_and_name.setString(2, name);
      ResultSet rs = select_entity_by_parent_and_name.executeQuery();
View Full Code Here

          int schema = rs.getInt(2);
          data.setCollection(parent);
          data.setSchema(schema == 0 ? null : makeSurrogate(database, DBObjectType.SCHEMA, schema));
          data.setName(rs.getString(3));
          data.setDescription(rs.getString(4));
          Chronicle chronicle = new ChronicleImpl(data);
          check(Permission.READ, chronicle);
          result.add(chronicle);
        }
        rs.close();
      } catch (SQLException e) {
View Full Code Here

TOP

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

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.