org.xmlBlaster.util.queue.jdbc
Class XBMeatFactory
java.lang.Object
org.xmlBlaster.util.queue.jdbc.XBFactoryBase
org.xmlBlaster.util.queue.jdbc.XBFactory
org.xmlBlaster.util.queue.jdbc.XBMeatFactory
public class XBMeatFactory
- extends XBFactory
Maps the database table XBMEAT to this java bean.
- Author:
- Marcel Ruff, Michele Laghi
Fields inherited from class org.xmlBlaster.util.queue.jdbc.XBFactory |
base, countSt, createSt, deleteAllSt, deleteCompleteSt, deleteSt, deleteTransientsSt, dropSt, getAllSt, getCompleteSt, getFirstEntriesSt, getNumOfAllSt, getSt, inList, insertSt, prefix, table |
Fields inherited from class org.xmlBlaster.util.queue.jdbc.XBFactoryBase |
DB2, FIREBIRD, HSQLDB, LDBC, MYSQL, ORACLE, POSTGRES, SQLITE, SQLSERVER_2000, SQLSERVER_2005, UNKNOWN |
Method Summary |
(package private) static XBMeat |
buildFromRs(java.sql.ResultSet rs,
int offset)
|
boolean |
create(java.sql.Connection conn)
Returns true if the table has been created, false otherwise. |
protected void |
doInit(I_Info info)
|
private void |
fillStatement(java.sql.PreparedStatement preStatement,
XBMeat xbMeat)
|
XBMeat |
get(XBStore store,
long id,
java.sql.Connection conn,
int timeout)
|
protected long |
getByteSize(java.sql.ResultSet rs,
int offset)
|
java.util.List<XBMeat> |
getFirstMeatEntries(XBStore store,
java.sql.Connection conn,
long numOfEntries,
long numOfBytes,
int timeout)
|
(package private) static java.lang.String |
getName()
|
void |
incrementRefCounters(XBStore store,
XBMeat meat,
long increment,
java.sql.Connection conn,
int timeout)
|
void |
insert(XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
Inserts an entry in the database |
protected void |
prepareDefaultStatements()
This method must be implemented in all underlying extentions to this class. |
protected XBMeat |
rsToEntry(XBStore store,
java.sql.ResultSet rs)
|
void |
update(XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
Updates the XBMeat object. |
void |
updateRefCounters(XBStore store,
XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
Updates the XBMeat object. |
Methods inherited from class org.xmlBlaster.util.queue.jdbc.XBFactory |
checkSameStore, count, delete, deleteList, deleteTransients, drop, fillDbCol, getDbCol, getList, getNumOfAll, init, isTrue, readStream, whereInStatement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final java.util.logging.Logger log
ID
private static final int ID
- See Also:
- Constant Field Values
DURABLE
private static final int DURABLE
- See Also:
- Constant Field Values
REF_COUNT
private static final int REF_COUNT
- See Also:
- Constant Field Values
REF_COUNT2
private static final int REF_COUNT2
- See Also:
- Constant Field Values
BYTE_SIZE
private static final int BYTE_SIZE
- See Also:
- Constant Field Values
DATA_TYPE
private static final int DATA_TYPE
- See Also:
- Constant Field Values
META_INFO
private static final int META_INFO
- See Also:
- Constant Field Values
FLAG1
private static final int FLAG1
- See Also:
- Constant Field Values
QOS
private static final int QOS
- See Also:
- Constant Field Values
CONTENT
private static final int CONTENT
- See Also:
- Constant Field Values
KEY
private static final int KEY
- See Also:
- Constant Field Values
STORE_ID
private static final int STORE_ID
- See Also:
- Constant Field Values
LAST_ROW
private static final int LAST_ROW
- See Also:
- Constant Field Values
updateRefCounterSt
private java.lang.String updateRefCounterSt
updateSt
private java.lang.String updateSt
incRefCounterFunction
private java.lang.String incRefCounterFunction
incRefCounterInvoke
private java.lang.String incRefCounterInvoke
XBMeatFactory
public XBMeatFactory(java.lang.String prefix)
getName
static java.lang.String getName()
prepareDefaultStatements
protected void prepareDefaultStatements()
- Description copied from class:
XBFactory
- This method must be implemented in all underlying extentions to this class. It returns (for the different
database vendors a default for the creation of the table.
- Overrides:
prepareDefaultStatements
in class XBFactory
doInit
protected void doInit(I_Info info)
- Specified by:
doInit
in class XBFactoryBase
create
public boolean create(java.sql.Connection conn)
throws java.sql.SQLException
- Description copied from class:
XBFactory
- Returns true if the table has been created, false otherwise. It returns false for example
if the table existed already, in which case it is not newly created.
- Overrides:
create
in class XBFactory
- Returns:
-
- Throws:
java.sql.SQLException
fillStatement
private void fillStatement(java.sql.PreparedStatement preStatement,
XBMeat xbMeat)
throws java.sql.SQLException,
java.io.IOException
- Throws:
java.sql.SQLException
java.io.IOException
insert
public void insert(XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
throws java.sql.SQLException,
java.io.IOException
- Inserts an entry in the database
- Parameters:
table
- xbMeat
- The object to store. Note thatconn
- The database connection to use set.
- Throws:
java.sql.SQLException
- If an exception occurs in the backend. For example if the entry
already exists in the database.
java.io.IOException
updateRefCounters
public void updateRefCounters(XBStore store,
XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
throws java.sql.SQLException
- Updates the XBMeat object. If qos, flag or
- Parameters:
table
- xbMeat
- conn
-
- Throws:
java.sql.SQLException
update
public void update(XBMeat xbMeat,
java.sql.Connection conn,
int timeout)
throws java.sql.SQLException,
java.io.IOException
- Updates the XBMeat object. If qos, flag or
- Parameters:
table
- xbMeat
- conn
-
- Throws:
java.sql.SQLException
java.io.IOException
incrementRefCounters
public void incrementRefCounters(XBStore store,
XBMeat meat,
long increment,
java.sql.Connection conn,
int timeout)
throws java.sql.SQLException,
java.io.IOException
- Throws:
java.sql.SQLException
java.io.IOException
buildFromRs
static final XBMeat buildFromRs(java.sql.ResultSet rs,
int offset)
throws java.sql.SQLException,
java.io.IOException
- Throws:
java.sql.SQLException
java.io.IOException
rsToEntry
protected XBMeat rsToEntry(XBStore store,
java.sql.ResultSet rs)
throws java.sql.SQLException,
java.io.IOException
- Specified by:
rsToEntry
in class XBFactory
- Throws:
java.sql.SQLException
java.io.IOException
get
public XBMeat get(XBStore store,
long id,
java.sql.Connection conn,
int timeout)
throws java.sql.SQLException,
java.io.IOException
- Parameters:
sql
- The select statement to use to fill the objects.conn
-
- Returns:
- null if the object has not been found or the object if it has been
found on the backend.
- Throws:
java.sql.SQLException
java.io.IOException
getFirstMeatEntries
public java.util.List<XBMeat> getFirstMeatEntries(XBStore store,
java.sql.Connection conn,
long numOfEntries,
long numOfBytes,
int timeout)
throws java.sql.SQLException,
java.io.IOException
- Parameters:
store
- conn
- numOfEntries
- numOfBytes
- timeout
-
- Returns:
-
- Throws:
java.sql.SQLException
java.io.IOException
getByteSize
protected long getByteSize(java.sql.ResultSet rs,
int offset)
throws java.sql.SQLException
- Specified by:
getByteSize
in class XBFactory
- Throws:
java.sql.SQLException
Copyright © 1999-2014 The xmlBlaster.org contributers.