|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--asgaard.skid.BeanBrokerCall
This class avoids the recreation from a set of objects like a database-connection and
hides the Database - layer. e.g. if stored procedures are available or not.
All the SQL-Code is encapsulated in this class, different SQL-dialects
are maintained with the Resource-classes SQLRes*.java
.
asgaard.skid.resources.SQLRes
Field Summary | |
protected static boolean |
blobWorkaround
|
static java.lang.String |
NAME_PREFIX
Method-name convention prefix: getXXXX - Methods are analyzed |
protected static java.util.ResourceBundle |
sRes
|
Constructor Summary | |
BeanBrokerCall(java.lang.String callStr,
java.lang.String stmtStr,
java.lang.String createStr,
boolean getResult)
Creeates a new database-call. |
Method Summary | |
static java.lang.String |
addAndClause(java.lang.String clause)
Returns the Clause with an prefix - AND |
static java.lang.String |
addListClause(java.lang.String clause)
Returns the Clause with an prefix - Semikolon |
java.sql.ResultSet |
exec(java.lang.Object[] args,
java.lang.String callPoint)
Does the wraped call including a backup (if LogLevel >= BACKUP). |
static java.lang.String |
getCreateKeyClause(java.lang.Class aClass)
Returns the Create-Clause for the Key(s) in the keytable |
static java.lang.String |
getCreateKeyToken(int fieldnr,
byte type,
java.lang.String part)
Returns a part of a CREATE statement to construct the Key-Table of an Bean. |
java.lang.String |
getFilterClause(byte fieldno,
byte filter,
java.lang.Object value,
java.lang.String where)
Returns a new Element in the Filter-clause. |
int |
getInt(int column)
Returns an int containing to the column-number and the actual resultset,
hides any SQL-Exception. |
static java.lang.String |
getKeyNullClause()
Returns an "null-Clause" for the Search in a Keytable |
long |
getLong(int column)
Returns an long containing to the column-number and the actual resultset,
hides any SQL-Exception. |
java.lang.Object |
getObject(int column,
boolean isBean)
Returns the Object containing to the column-number and the actual resultset, hides any SQL-Exception. |
static java.lang.String |
getSecondaryKeyClause(int fieldno)
Returns the Key-Clause for the second Key |
static java.lang.String |
getSelectKeyToken(int fieldnr,
byte op,
java.lang.String value)
Creates a Token for selecting from a Key-Table. |
protected static java.lang.String |
getSQLOp(byte filter,
java.lang.String prefix,
java.lang.String postfix)
Returns the Operater in SQL-syntax defined by BeanBroker.FILTER_* adding
an prefix- and postfix String. |
java.lang.String |
getString(int column)
Returns an String containing to the column-number and the actual resultset,
hides any SQL-Exception. |
static java.lang.String |
getTableName(java.lang.Class aClass)
Generates the Tablename for the keys of a Class |
java.lang.String |
getZeroClause(byte fieldno)
Returns a Filter-clause > 0. |
boolean |
next()
Indicates, if there is a next Entry at the Resultset, hides any SQL-Exception. |
static void |
setConnection(java.sql.Connection aConn,
asgaard.utils.log.LogClient aLog,
java.util.ResourceBundle sqlRes)
Creeates a new database-call. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String NAME_PREFIX
protected static boolean blobWorkaround
protected static java.util.ResourceBundle sRes
Constructor Detail |
public BeanBrokerCall(java.lang.String callStr, java.lang.String stmtStr, java.lang.String createStr, boolean getResult) throws java.sql.SQLException
callStr
- the Statement (parameterless)stmtStr
- the Log-Statement for automated backup (without stored procedure call)getResult
- if the preprocessed statement produces a ResultSet or notcreateStr
- is the CREATE TABLE
Statement to analyze the parameter names (optional).Method Detail |
public static void setConnection(java.sql.Connection aConn, asgaard.utils.log.LogClient aLog, java.util.ResourceBundle sqlRes)
Conn
- the database - connectionLog
- the Log for automated backupsqlRes
- the SQL-Syntax-Resourcespublic java.sql.ResultSet exec(java.lang.Object[] args, java.lang.String callPoint) throws java.sql.SQLException
args
- a set of Arguments as String
, for Backup all none-Strings are encoded to HEX.callPoint
- the Servicepoint for the call (used for the LogMsg)public java.lang.Object getObject(int column, boolean isBean)
column
- number of the field, first starts with 1isBean
- if the Object may be encodedpublic int getInt(int column)
int
containing to the column-number and the actual resultset,
hides any SQL-Exception.column
- number of the field, first starts with 1public java.lang.String getString(int column)
String
containing to the column-number and the actual resultset,
hides any SQL-Exception.column
- number of the field, first starts with 1null
if it fails)public long getLong(int column)
long
containing to the column-number and the actual resultset,
hides any SQL-Exception.column
- number of the field, first starts with 1public boolean next()
public java.lang.String getFilterClause(byte fieldno, byte filter, java.lang.Object value, java.lang.String where)
fieldno
- number of the field (starts with 0)filter
- the filter-codevalue
- the value to compare (to a String
quotes are added)where
- the old clausepublic static java.lang.String getTableName(java.lang.Class aClass) throws java.rmi.RemoteException
public static java.lang.String getKeyNullClause()
public static java.lang.String getCreateKeyClause(java.lang.Class aClass)
Class
- the class generate the key-clausepublic static java.lang.String addListClause(java.lang.String clause)
clause
- the tokenpublic static java.lang.String addAndClause(java.lang.String clause)
clause
- the tokenpublic static java.lang.String getSecondaryKeyClause(int fieldno)
fieldno
- the number of the propertypublic static java.lang.String getCreateKeyToken(int fieldnr, byte type, java.lang.String part)
fieldnr
- number of the getXXX-method (by Class.getMethods
)type
- of the Return-Type of the methodpart
- the old tokenpublic static java.lang.String getSelectKeyToken(int fieldnr, byte op, java.lang.String value)
public java.lang.String getZeroClause(byte fieldno)
fieldno
- number of the field (starts with 0)protected static java.lang.String getSQLOp(byte filter, java.lang.String prefix, java.lang.String postfix)
BeanBroker.FILTER_*
adding
an prefix- and postfix String.filter
- the filter-codeprefix
- the prefixpostfix
- the postfix
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |