public void addPreparedArgument( String column, Object value, String literal ) { addPreparedArgument( new SQLIdentifier( column ), value, literal ); }
/** * Returns the name of the schema. * * @return the name of the schema, can be <code>null</code> (default schema) */ public String getSchema() { return getQualifier(); }
/** * * @param column * the name of the column, must not be <code>null</code> * @param value * the value to append, can be <code>null</code> */ public void addPreparedArgument( SQLIdentifier column, Object value ) { addPreparedArgument( column, value, "?" ); }
private void insertAssociation( Association association, int regPackId, Connection conn ) throws SQLException { InsertRow ir = new InsertRow( new TableName( Table.idxtb_association.name() ), null ); addRegistryObject( ir, association ); ir.addPreparedArgument( new SQLIdentifier( "sourceObject" ), association.getSourceObject() ); ir.addPreparedArgument( new SQLIdentifier( "targetObject" ), association.getTargetObject() ); ir.addPreparedArgument( new SQLIdentifier( "associationType" ), association.getAssociationType() ); ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( association.getElement() ) ); ir.addPreparedArgument( new SQLIdentifier( "fk_registrypackage" ), regPackId ); ir.performInsert( conn ); }
public BBoxTableMapping( String ftTable, ICRS crs ) { this.ftTable = new TableName( ftTable ); this.crs = crs; }
private void addRegistryObject( InsertRow ir, RegistryObject ro ) { ir.addPreparedArgument( new SQLIdentifier( "id" ), ro.getId() ); ir.addPreparedArgument( new SQLIdentifier( "objectType" ), ro.getObjectType() ); ir.addPreparedArgument( new SQLIdentifier( "home" ), ro.getHome() ); ir.addPreparedArgument( new SQLIdentifier( "lid" ), ro.getLid() ); ir.addPreparedArgument( new SQLIdentifier( "status" ), ro.getStatus() ); ir.addPreparedArgument( new SQLIdentifier( "externalId" ), ro.getExtId() ); ir.addPreparedArgument( new SQLIdentifier( "name" ), ro.getName() ); ir.addPreparedArgument( new SQLIdentifier( "description" ), ro.getDesc() ); ir.addPreparedArgument( new SQLIdentifier( "versionInfo" ), ro.getVersionInfo() ); }
/** * Returns the name of the table (without schema). * * @return the name of the table, never <code>null</code> */ public String getTable() { return getName(); }
@Override public boolean equals( Object obj ) { if ( !( obj instanceof KeyPropagation ) ) { return false; } KeyPropagation that = (KeyPropagation) obj; if ( !this.source.equals( that.source ) || !this.target.equals( that.target ) ) { return false; } for ( int i = 0; i < pkColumns.size(); i++ ) { if ( !this.pkColumns.get( i ).equals( that.pkColumns.get( i ) ) ) { return false; } if ( !this.fkColumns.get( i ).equals( that.fkColumns.get( i ) ) ) { return false; } } return true; }
private String getPkConstraintName( TableName ftTable ) { String s = null; String table = ftTable.getTable(); if ( table.endsWith( "\"" ) ) { s = table.substring( 0, table.length() - 1 ) + "_pkey\""; } else { s = table + "_pkey"; } return s; }
@Override public String toString() { return getSql(); }
@Override public void invalidate( Connection conn ) { try { pool.invalidate( (DelegatingConnection) conn ); } catch ( Exception e ) { throw new RuntimeException( e ); } }
/** * Returns the name of the global id lookup table (that allows the lookup of features / geometries by id). * * @return the name of the lookup table, can be <code>null</code> (no global lookup table, only per feature type) */ public String getIdLookupTable() { if ( blobMapping == null ) { return null; } return blobMapping.getTable().toString(); }
private void insertClassification( Classification classification, int regPackId, Connection conn ) throws SQLException { InsertRow ir = new InsertRow( new TableName( Table.idxtb_classification.name() ), null ); addRegistryObject( ir, classification ); ir.addPreparedArgument( new SQLIdentifier( "classificationNode" ), classification.getClassificationNode() ); ir.addPreparedArgument( new SQLIdentifier( "classifiedObject" ), classification.getClassifiedObject() ); ir.addPreparedArgument( new SQLIdentifier( "classificationScheme" ), classification.getClassificationScheme() ); ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( classification.getElement() ) ); ir.addPreparedArgument( new SQLIdentifier( "fk_registrypackage" ), regPackId ); ir.performInsert( conn ); }
public void addPreparedArgument( String column, Object value ) { addPreparedArgument( new SQLIdentifier( column ), value, "?" ); }
/** * Creates a new {@link BlobMapping} instance. * * @param table * the name of the table that stores the BLOBs, must not be <code>null</code> * @param storageCRS * crs used for storing geometries / envelopes, must not be <code>null</code> * @param codec * the decoder / encoder used for the BLOBs, must not be <code>null</code> */ public BlobMapping( String table, ICRS storageCRS, BlobCodec codec ) { this.table = new TableName( table ); this.storageCRS = storageCRS; this.codec = codec; }
private void insertClassificationNode( ClassificationNode classificationNode, int regPackId, Connection conn ) throws SQLException { InsertRow ir = new InsertRow( new TableName( Table.idxtb_classificationNode.name() ), null ); addRegistryObject( ir, classificationNode ); ir.addPreparedArgument( new SQLIdentifier( "parent" ), classificationNode.getParent() ); ir.addPreparedArgument( new SQLIdentifier( "code" ), classificationNode.getCode() ); ir.addPreparedArgument( new SQLIdentifier( "path" ), classificationNode.getPath() ); ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( classificationNode.getElement() ) ); ir.addPreparedArgument( new SQLIdentifier( "fk_registrypackage" ), regPackId ); ir.performInsert( conn ); }
public static TableName createFromQualifiedName( String tableName ) { String table = tableName; String schema = null; if ( table.contains( "." ) ) { String[] splittedQualifiedTableName = table.split( "[.]" ); schema = splittedQualifiedTableName[0]; table = splittedQualifiedTableName[1]; } return new TableName( table, schema ); } }