Tabnine Logo
InsertRow
Code IndexAdd Tabnine to your IDE (free)

How to use
InsertRow
in
org.deegree.commons.jdbc

Best Java code snippets using org.deegree.commons.jdbc.InsertRow (Showing top 13 results out of 315)

origin: deegree/deegree3

private void insertInOperatesOnTable( Connection conn, int operatesOnId, QueryableProperties qp )
            throws MetadataStoreException {
  List<OperatesOnData> opOns = qp.getOperatesOnData();
  if ( opOns != null && opOns.size() > 0 ) {
    for ( OperatesOnData opOn : opOns ) {
      InsertRow ir = new InsertRow( new TableName( opOnTable ), null );
      try {
        int localId = getNewIdentifier( conn, opOnTable );
        ir.addPreparedArgument( idColumn, localId );
        ir.addPreparedArgument( fk_main, operatesOnId );
        ir.addPreparedArgument( "operateson", opOn.getOperatesOnId() );
        ir.addPreparedArgument( "operatesonid", opOn.getOperatesOnIdentifier() );
        ir.addPreparedArgument( "operatesonname", opOn.getOperatesOnName() );
        LOG.debug( ir.getSql() );
        ir.performInsert( conn );
      } catch ( SQLException e ) {
        String msg = Messages.getMessage( "ERROR_SQL", ir.getSql(), e.getMessage() );
        LOG.debug( msg );
        throw new MetadataStoreException( msg );
      }
    }
  }
}
origin: deegree/deegree3

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 );
}
origin: deegree/deegree3

String sql = getSql();
PreparedStatement stmt = null;
if ( autogenColumn == null ) {
origin: deegree/deegree3

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() );
}
origin: deegree/deegree3

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 );
}
origin: deegree/deegree3

    ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), wkt, sb.toString() );
  } catch ( ParseException e ) {
    String msg = "Could not write as WKB " + geom + ": " + e.getMessage();
ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), concatenate( slotValue ) );
case _date:
  try {
    ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ),
                new Timestamp(
                        ( parseDateTime( slotValue ).getTimeInMilliseconds() ) ) );
case _double:
  try {
    ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), Double.parseDouble( slotValue ) );
  } catch ( NumberFormatException e ) {
    String msg = "Could not parse as double:" + slotValue;
case _int:
  try {
    ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), Integer.parseInt( slotValue ) );
  } catch ( NumberFormatException e ) {
    String msg = "Could not parse as integer:" + slotValue;
  ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), slotValue );
  break;
origin: deegree/deegree3

private void insertInKeywordTable( Connection conn, int operatesOnId, QueryableProperties qp )
            throws MetadataStoreException {
  List<Keyword> keywords = qp.getKeywords();
  if ( keywords != null && keywords.size() > 0 ) {
    for ( Keyword keyword : keywords ) {
      InsertRow ir = new InsertRow( new TableName( keywordTable ), null );
      try {
        int localId = getNewIdentifier( conn, keywordTable );
        ir.addPreparedArgument( idColumn, localId );
        ir.addPreparedArgument( fk_main, operatesOnId );
        ir.addPreparedArgument( "keywordtype", keyword.getKeywordType() );
        ir.addPreparedArgument( "keywords", concatenate( keyword.getKeywords() ) );
        LOG.debug( ir.getSql() );
        ir.performInsert( conn );
      } catch ( SQLException e ) {
        String msg = Messages.getMessage( "ERROR_SQL", ir.getSql(), e.getMessage() );
        LOG.debug( msg );
        throw new MetadataStoreException( msg );
      }
    }
  }
}
origin: deegree/deegree3

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 );
}
origin: deegree/deegree3

@Override
public synchronized int executeInsert( Connection conn, ISORecord rec )
            throws MetadataStoreException, XMLStreamException {
  int internalId = 0;
  InsertRow ir = new InsertRow( new TableName( mainTable ), null );
  try {
    internalId = getLastDatasetId( conn, mainTable );
    internalId++;
    ir.addPreparedArgument( idColumn, internalId );
    ir.addPreparedArgument( recordColumn, rec.getAsByteArray() );
    ir.addPreparedArgument( "fileidentifier", rec.getIdentifier() );
    ir.addPreparedArgument( "version", null );
    ir.addPreparedArgument( "status", null );
    appendValues( rec, ir );
    LOG.debug( ir.getSql() );
    ir.performInsert( conn );
    QueryableProperties qp = rec.getParsedElement().getQueryableProperties();
    insertNewValues( conn, internalId, qp );
  } catch ( SQLException e ) {
    String msg = Messages.getMessage( "ERROR_SQL", ir.getSql(), e.getMessage() );
    LOG.debug( msg );
    throw new MetadataStoreException( msg );
  }
  return internalId;
}
origin: deegree/deegree3

stmt.execute();
InsertRow ir = new InsertRow( new TableName( "management" ), null );
ir.addPreparedArgument( new SQLIdentifier( "key" ), "REGISTRYPACKAGE_ID" );
ir.addPreparedArgument( new SQLIdentifier( "value" ), insertedId );
ir.performInsert( conn );
ir = new InsertRow( new TableName( "management" ), null );
ir.addPreparedArgument( new SQLIdentifier( "key" ), "LAST_INSERTED" );
ir.addPreparedArgument( new SQLIdentifier( "value" ), ISO8601Converter.formatDateTime( new Date() ) );
ir.performInsert( conn );
origin: deegree/deegree3

private void insertInCRSTable( Connection conn, int operatesOnId, QueryableProperties qp )
            throws MetadataStoreException {
  List<CRS> crss = qp.getCrs();
  if ( crss != null && crss.size() > 0 ) {
    for ( CRS crs : crss ) {
      InsertRow ir = new InsertRow( new TableName( crsTable ), null );
      try {
        int localId = getNewIdentifier( conn, crsTable );
        ir.addPreparedArgument( idColumn, localId );
        ir.addPreparedArgument( fk_main, operatesOnId );
        ir.addPreparedArgument( "authority",
                    ( crs.getAuthority() != null && crs.getAuthority().length() > 0 ) ? crs.getAuthority()
                                                     : null );
        ir.addPreparedArgument( "crsid",
                    ( crs.getCrsId() != null && crs.getCrsId().length() > 0 ) ? crs.getCrsId()
                                                 : null );
        ir.addPreparedArgument( "version",
                    ( crs.getVersion() != null && crs.getVersion().length() > 0 ) ? crs.getVersion()
                                                   : null );
        LOG.debug( ir.getSql() );
        ir.performInsert( conn );
      } catch ( SQLException e ) {
        String msg = Messages.getMessage( "ERROR_SQL", ir.getSql(), e.getMessage() );
        LOG.debug( msg );
        throw new MetadataStoreException( msg );
      }
    }
  }
}
origin: deegree/deegree3

private void insertExtrinsicObject( ExtrinsicObject eo, int regPackId, Connection conn )
            throws SQLException {
  InsertRow ir = new InsertRow( new TableName( Table.idxtb_extrinsicobject.name() ), null );
  addRegistryObject( ir, eo );
  ir.addPreparedArgument( new SQLIdentifier( "resource" ), eo.getResource() );
  ir.addPreparedArgument( new SQLIdentifier( "isopaque" ), eo.isOpaque() );
  ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( eo.getElement() ) );
  ir.addPreparedArgument( new SQLIdentifier( "fk_registrypackage" ), regPackId );
    slots = PRODUCT.getSlots();
  } else if ( ACQUPLATFORM.getType().equals( eo.getObjectType() ) ) {
    ir.addPreparedArgument( new SQLIdentifier( "ap_shortName" ), eo.getName() );
    slots = ACQUPLATFORM.getSlots();
  } else if ( MASKINFO.getType().equals( eo.getObjectType() ) ) {
    ir.addPreparedArgument( new SQLIdentifier( "mi_type" ), eo.getName() );
    slots = MASKINFO.getSlots();
  } else if ( ARCHIVINGINFO.getType().equals( eo.getObjectType() ) ) {
    ir.addPreparedArgument( new SQLIdentifier( "ai_archivingCenter" ), eo.getName() );
    slots = ARCHIVINGINFO.getSlots();
  } else if ( PRODUCTINFO.getType().equals( eo.getObjectType() ) ) {
    slots = PRODUCTINFO.getSlots();
  } else if ( DATALAYER.getType().equals( eo.getObjectType() ) ) {
    ir.addPreparedArgument( new SQLIdentifier( "dl_specy" ), eo.getName() );
    slots = DATALAYER.getSlots();
  } else if ( BROWSEINFO.getType().equals( eo.getObjectType() ) ) {
    ir.addPreparedArgument( new SQLIdentifier( "bi_type" ), eo.getName() );
    slots = BROWSEINFO.getSlots();
origin: deegree/deegree3

          throws MetadataStoreException {
InsertRow ir = new InsertRow( new TableName( Table.idxtb_registrypackage.name() ), null );
try {
  int id = getNewId( conn );
  ir.addPreparedArgument( new SQLIdentifier( "internalId" ), id );
  ir.addPreparedArgument( new SQLIdentifier( "id" ), registryPackage.getId() );
  ir.addPreparedArgument( new SQLIdentifier( "externalId" ), registryPackage.getExtId() );
  ir.addPreparedArgument( new SQLIdentifier( "name" ), registryPackage.getName() );
  ir.addPreparedArgument( new SQLIdentifier( "description" ), registryPackage.getDesc() );
  ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( registryPackage.getElement() ) );
  LOG.debug( "Execute statement " + ir.getSql() );
  ir.performInsert( conn );
org.deegree.commons.jdbcInsertRow

Javadoc

Encapsulates columns and values for inserting one row into a database table.

Most used methods

  • getSql
  • <init>
    Creates a new InsertRow instance.
  • addPreparedArgument
  • performInsert
    Performs the insertion and deals with autogenerated columns.

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Table (org.hibernate.mapping)
    A relational table
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now