Package org.apache.empire.jsf2.app
Class WebDBContext<DB extends DBDatabase>
java.lang.Object
org.apache.empire.db.context.DBContextBase
org.apache.empire.jsf2.app.WebDBContext<DB>
- All Implemented Interfaces:
Serializable,DBContext
This is the basic implementation of a DBContext for a web application
Important: The connection is obtained on HttpRequest scope and hot held by the context
The connection is automatically released via the FacesRequestPhaseListener
- Author:
- rainer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final WebApplicationprotected final DBprotected final DBMSHandler -
Constructor Summary
ConstructorsConstructorDescriptionWebDBContext(DB db) ConstructorWebDBContext(DB db, boolean rollbackHandlingEnabled) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoiddiscard()Unclear weather this is any useful hereprotected ConnectiongetConnection(boolean create) getDbms()javax.faces.context.FacesContextprotected DBRollbackManagergetRollbackManager(boolean create) booleanbooleanMethods inherited from class org.apache.empire.db.context.DBContextBase
appendRollbackHandler, closeConnection, commit, createCommand, createUtils, executeDelete, executeInsert, executeInsertInto, executeSQL, executeUpdate, getConnection, getUtils, removeRollbackHandler, rollback, setUtils
-
Field Details
-
app
-
database
-
dbms
-
-
Constructor Details
-
WebDBContext
Constructor- Parameters:
db- the databaserollbackHandlingEnabled- flag whether to enable rollback handling
-
WebDBContext
Constructor- Parameters:
db- the database
-
-
Method Details
-
getDatabase
-
getDbms
-
isPreparedStatementsEnabled
public boolean isPreparedStatementsEnabled()- Specified by:
isPreparedStatementsEnabledin classDBContextBase
-
isRollbackHandlingEnabled
public boolean isRollbackHandlingEnabled()- Specified by:
isRollbackHandlingEnabledin interfaceDBContext
-
discard
public void discard()Unclear weather this is any useful here- Specified by:
discardin interfaceDBContext- Overrides:
discardin classDBContextBase
-
getConnection
- Specified by:
getConnectionin classDBContextBase
-
getRollbackManager
- Specified by:
getRollbackManagerin classDBContextBase
-
getFacesContext
public javax.faces.context.FacesContext getFacesContext()
-