net.datacrow.core.db
Class Query
java.lang.Object
net.datacrow.core.db.Query
- Direct Known Subclasses:
- CreateQuery, DeleteQuery, InsertQuery, SelectQuery, UpdateQuery
public abstract class Query
- extends java.lang.Object
The Query class creates SQL statements needed to remove, update, insert and
select items from the database. Queries created by this class ensure the integrity
of the data.
Note that the Query class can actually contain several SQL statements.
- Author:
- Robert Jan van der Waals
Constructor Summary |
Query(int module,
Requests requests)
Constructs a new Query object. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Query
public Query(int module,
Requests requests)
- Constructs a new Query object.
- Parameters:
queryType
- type of querydco
- templateoptions
- query optionsrequests
- actions / requests to be executed
- Throws:
java.sql.SQLException
clear
protected void clear()
isLog
public boolean isLog()
setLog
public void setLog(boolean log)
run
public abstract java.util.List<DcObject> run()
handleRequest
protected void handleRequest(boolean success)
getPreparedStament
protected java.sql.PreparedStatement getPreparedStament(java.lang.String sql)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
setValues
protected void setValues(java.sql.PreparedStatement ps,
java.util.Collection<java.lang.Object> values)
getQueryValue
protected java.lang.Object getQueryValue(DcObject dco,
int index)
getModuleIdx
public int getModuleIdx()
getModule
public DcModule getModule()
getRequests
public Requests getRequests()
- Gets the requests waiting to be executed.
createReferences
protected void createReferences(DcObject dco)
deleteImage
protected void deleteImage(Picture picture)
saveImage
protected void saveImage(Picture picture)
finalize
protected void finalize()
throws java.lang.Throwable
- Overrides:
finalize
in class java.lang.Object
- Throws:
java.lang.Throwable