Package com.caucho.jdbc

Examples of com.caucho.jdbc.JdbcMetaData


    }

    if (gen == null) {
    }
    else {
      JdbcMetaData metaData = null;

      /* XXX: validation needs to occur later
      try {
        metaData = persistenceUnit.getMetaData();
      } catch (ConfigException e) {
View Full Code Here


  {
    log.log(Level.FINER, e.toString(), e);

    String sqlState = e.getSQLState();

    JdbcMetaData metaData = _persistenceUnit.getMetaData();

    if (metaData.isUniqueConstraintSQLState(sqlState)) {
      // jpa/0ga5
      throw new EntityExistsException(L.l("Trying to persist an entity '{0}[{1}]' that already exists. Entity state '{2}'", entity.getClass().getName(), entity.__caucho_getPrimaryKey(), entity.__caucho_getEntityState()));
    }
    else if (metaData.isForeignKeyViolationSQLState(sqlState)) {
      // jpa/0o42
      throw new IllegalStateException(L.l("Trying to persist an entity of class '{0}' with PK '{1}' would break a foreign key constraint. The entity state is '{2}'. Please make sure there are associated entities for all required relationships. If you are merging an entity make sure the association fields are annotated with cascade=MERGE or cascade=ALL.", entity.getClass().getName(), entity.__caucho_getPrimaryKey(), entity.__caucho_getEntityState()));
    }

    throw e;
View Full Code Here

    _isInit = true;

    DataSource ds = amberPersistenceUnit.getDataSource();
    Connection conn = ds.getConnection();
    try {
      JdbcMetaData metaData = amberPersistenceUnit.getMetaData();

      _selectSQL = metaData.selectSequenceSQL(_name);

      if (amberPersistenceUnit.getCreateDatabaseTables()) {
        String sql = metaData.createSequenceSQL(_name, getGroupSize());

        try {
          Statement stmt = conn.createStatement();
          stmt.executeUpdate(sql);
          stmt.close();
View Full Code Here

    String sql = _query.getSQL();

    int row = 0;

    if (maxResults > 0 && maxResults < LIMIT_INF) {
      JdbcMetaData metaData = _aConn.getAmberManager().getMetaData();

      // XXX: should limit meta-data as well?
      // jps/1431
      if (metaData.isLimitOffset()) {
  sql = metaData.limit(sql, firstResults, maxResults);
  row = firstResults;
      }
      else
  sql = metaData.limit(sql, 0, firstResults + maxResults);
    }

    PreparedStatement pstmt = _aConn.prepareStatement(sql);
    ArgExpr []args = _query.getArgList();
View Full Code Here

TOP

Related Classes of com.caucho.jdbc.JdbcMetaData

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.