org.culturegraph.mf.sql.pipe
Class SqlStatementPipe

java.lang.Object
  extended by org.culturegraph.mf.framework.DefaultSender<R>
      extended by org.culturegraph.mf.framework.DefaultObjectPipe<String,org.culturegraph.mf.framework.StreamReceiver>
          extended by org.culturegraph.mf.sql.pipe.SqlStatementPipe
All Implemented Interfaces:
org.culturegraph.mf.framework.LifeCycle, org.culturegraph.mf.framework.ObjectPipe<String,org.culturegraph.mf.framework.StreamReceiver>, org.culturegraph.mf.framework.ObjectReceiver<String>, org.culturegraph.mf.framework.Receiver, org.culturegraph.mf.framework.Sender<org.culturegraph.mf.framework.StreamReceiver>

@Description(value="Executes the received string object as an SQL statement.")
@In(value=java.lang.String.class)
@Out(value=org.culturegraph.mf.framework.StreamReceiver.class)
public final class SqlStatementPipe
extends org.culturegraph.mf.framework.DefaultObjectPipe<String,org.culturegraph.mf.framework.StreamReceiver>

Executes the received string object as an SQL statement. Each row of the result sets produced by the statement is emitted as a new record. The module also emits generated keys as new records. Use SqlStatementPipe for SQL statements which do not produce any result sets. In many situations it can be preferable to use prepared statements instead of hand-crafted SQL. Use in such situations.

Author:
Christoph Böhme
See Also:
SqlStatementSink, SqlStreamPipe

Constructor Summary
SqlStatementPipe(Connection connection)
           
SqlStatementPipe(String datasource)
           
 
Method Summary
 void process(String sql)
           
 void setIdColumnLabel(String idColumnLabel)
           
 
Methods inherited from class org.culturegraph.mf.framework.DefaultSender
closeStream, isClosed, resetStream, setReceiver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.culturegraph.mf.framework.LifeCycle
closeStream, resetStream
 
Methods inherited from interface org.culturegraph.mf.framework.Sender
setReceiver
 

Constructor Detail

SqlStatementPipe

public SqlStatementPipe(String datasource)

SqlStatementPipe

public SqlStatementPipe(Connection connection)
Method Detail

setIdColumnLabel

public void setIdColumnLabel(String idColumnLabel)

process

public void process(String sql)
Specified by:
process in interface org.culturegraph.mf.framework.ObjectReceiver<String>
Overrides:
process in class org.culturegraph.mf.framework.DefaultObjectPipe<String,org.culturegraph.mf.framework.StreamReceiver>


Copyright © 2014. All Rights Reserved.