public class LogControl extends Object
Modifier and Type | Field and Description |
---|---|
private int |
batchCount |
private int |
batchSize |
private WeakReference<DbControl> |
dc |
private PreparedStatement |
insertIntoDetails |
private StatelessSession |
session |
private TransactionDetails |
transactionDetails |
Constructor and Description |
---|
LogControl(DbControl dc) |
Modifier and Type | Method and Description |
---|---|
Query |
createHqlQuery(String hql)
Creates a Hibernate HQL query.
|
Query |
createSqlQuery(String sql)
Creates a Hibernate SQL query.
|
void |
flush()
Flushes any batched changes to the database.
|
private StatelessSession |
getSession() |
TransactionDetails |
getTransactionDetails()
Get information about the current transaction.
|
void |
log(ChangeHistoryData history)
Add a main entry the change history table.
|
void |
log(ChangeHistoryDetailData detail)
Adds information about a modified entity to the change history
table.
|
private final WeakReference<DbControl> dc
private TransactionDetails transactionDetails
private StatelessSession session
private PreparedStatement insertIntoDetails
private final int batchSize
private int batchCount
LogControl(DbControl dc)
public TransactionDetails getTransactionDetails()
public void log(ChangeHistoryData history)
log(ChangeHistoryDetailData)
.history
- A fully initialized ChangeHistoryData objectpublic void log(ChangeHistoryDetailData detail)
detail
- A fully initialized ChangeHistoryDetailData object
including a link to ChangeHistoryData
that has
been logged with log(ChangeHistoryData)
public Query createHqlQuery(String hql)
public void flush()
public Query createSqlQuery(String sql)
private StatelessSession getSession()