Examples of RowKey


Examples of com.sun.data.provider.RowKey

       
        return "new";
    }

    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Advertisement advertisement = (Advertisement)list.getObject(rk);
            getSessionBean1().setAdvertisement(advertisement);
        }
       
View Full Code Here

Examples of com.sun.data.provider.RowKey

       
        return "edit";
    }

    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Advertisement advertisement = (Advertisement)list.getObject(rk);
            deleteAdvertisement(advertisement);
        }
        list.refreshListPartnership();
View Full Code Here

Examples of org.apache.ode.bpel.extvar.jdbc.DbExternalVariable.RowKey

        DbExternalVariable evar = _vars.get(evarId);
        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo

        RowVal val = evar.parseXmlRow(evar.new RowVal(), (Element) newval.value);
        RowKey key = evar.keyFromLocator(newval.locator);

        if (key.isComplete() && evar._initType == InitType.delete_insert) {
            // do delete...
            // TODO
        }

        // should we try an update first? to do this we need to have all the required keys
        // and there should be some keys
        boolean tryupdatefirst = (evar._initType == InitType.update || evar._initType == InitType.update_insert)
                && !evar._keycolumns.isEmpty() && key.isComplete();

        boolean insert = evar._initType != InitType.update;

        try {
            if (tryupdatefirst)
                insert = execUpdate(evar, val) == 0;
            if (insert) {
                key = execInsert(evar, newval.locator, val);
                // Transfer the keys obtained from the db.
                key.write(newval.locator);
            }
        } catch (SQLException se) {
            throw new ExternalVariableModuleException("Error updating row.", se);
        }
View Full Code Here

Examples of org.apache.ode.bpel.extvar.jdbc.DbExternalVariable.RowKey

        }

    }

    RowVal execSelect(DbExternalVariable dbev, Locator locator) throws SQLException, ExternalVariableModuleException {
        RowKey rowkey = dbev.keyFromLocator(locator);
       
        if (!rowkey.isComplete()) {
          throw new IncompleteKeyException(rowkey.getMissing());
        }
       
        RowVal ret = dbev.new RowVal();
        Connection conn = dbev.dataSource.getConnection();
        try {
View Full Code Here

Examples of org.apache.ode.bpel.extvar.jdbc.DbExternalVariable.RowKey

        return ret;
    }

    RowKey execInsert(DbExternalVariable dbev, Locator locator, RowVal values) throws SQLException {
        RowKey keys = dbev.new RowKey();
        Connection conn = dbev.dataSource.getConnection();
        try {
            PreparedStatement stmt = dbev.generatedKeys ? conn.prepareStatement(dbev.insert, dbev._autoColNames) : conn
                    .prepareStatement(dbev.insert);
            int idx = 1;
            for (Column c : dbev._inscolumns) {
                Object val = c.getValue(c.name, values, locator.iid);
                values.put(c.name, val);
                stmt.setObject(idx, val);
                idx++;
            }

            stmt.execute();

            if (dbev.generatedKeys) {
                // With JDBC 3, we can get the values of the key columns (if the db supports it)
                ResultSet keyRS = stmt.getResultSet();
                keyRS.next();
                for (Column ck : keys._columns)
                    keys.put(ck.name, keyRS.getObject(ck.colname));
            } else {
                for (Column ck : keys._columns) {
                    Object val = values.get(ck.name);
                    keys.put(ck.name,val);
                }
            }

            return keys;
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

    for ( int i = 0; i < columnNames.length; i++ ) {
      String columnName = columnNames[i];
      columnValues[i] = associationKey.getMetadata().isKeyColumn( columnName ) ? associationKey.getColumnValue( columnName ) : accessor.get( row, columnName );
    }

    return new RowKey( table , columnNames, columnValues, null );
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

              includeColumns[propertyIndex],
              session
          );
    Object[] columnValues = LogicalPhysicalConverterHelper.getColumnValuesFromResultset( tuple, rowKeyColumnNames );
    EntityKey targetKey = associationPersister.createTargetKey( rowKeyColumnNames, columnValues );
    final RowKey rowKey = new RowKey( persister.getTableName(), rowKeyColumnNames, columnValues, targetKey );

    Tuple assocEntryTuple = associationPersister.createAndPutAssociationTuple( rowKey );
    for ( String column : tuple.getColumnNames() ) {
      assocEntryTuple.put( column, tuple.get( column ) );
    }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

    Association propertyValues = associationPersister.getAssociation();
    if ( propertyValues != null ) {
      //Map's equals operation delegates to all it's key and value, should be fine for now
      //this is a StarToOne case ie the FK is on the owning entity
      final RowKey matchingTuple = new RowKeyBuilder()
          .tableName( persister.getTableName() )
          .addColumns( buildRowKeyColumnNamesForStarToOne( persister, propertyColumnNames ) )
          .values( tupleKey )
          .entityKey( associationPersister.createTargetKey( rowKeyColumnNames, tupleKey ) )
          .build();
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

    while ( entries.hasNext() ) {
      Object entry = entries.next();
      if ( collection.needsUpdating( entry, i, elementType ) ) {
        // find the matching element
        RowKey assocEntryKey = getTupleKeyForUpdate( key, collection, session, i, entry, associationPersister );
        Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
        if ( assocEntryTuple == null ) {
          throw new AssertionFailure( "Updating a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + key + "} entry {" + entry + "}" );
        }
        // update the matching element
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

      if ( deletes.hasNext() ) {
        int count = 0;
        while ( deletes.hasNext() ) {
          Object entry = deletes.next();
          // find the matching element
          RowKey assocEntryKey = getTupleKeyForDelete( id, collection, session, entry, deleteByIndex, associationPersister );
          Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
          if ( assocEntryTuple == null ) {
            throw new AssertionFailure( "Deleting a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + id + "} entry {" + entry + "}" );
          }
          // delete the tuple
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.