public class Accessor
extends java.lang.Object
Primarily it has been design to support a robust encapsulating laboratory
that can host constructs and more in general methods that make access
somewhere, hiding the name space used in their implementation, and, what is
the most important thing, is capable to live either in the client side of the
Joty technology (that is instantiated by the Application
object) or
on the server side (that is instantiated by the JotyServlet
object).
The purpose of hiding the operative name space is directed towards the database, however, as it is, an Accessor instance can be used to have it interacting with any system is 'visible' in the context of life of the accessor itself.
Then, in the class, there is support for writing sql statements selecting and disposing data, support for invoking database stored procedures, support for pure substitution maps that may serve for replacements of place-holders located in the sql statements formed in the client side.
All the features implemented in a Accessor descendant class using the built-in defining constructs can be invoked by name or by the context of the client visual object.
An accessor instance, as it is, can hosts even pure computation that is demanded far away from the client machine, implementing, this way, simple client-server paradigm.
The design of this class is strictly connected to those ones of the
ParamContext
class and PostStatement
class. All together they
support the transferability of context parameters (or more specifically
dialog context parameters) from the location where they take value to the
location where their values are used, location, the latter, that may be the
same as the former (in the client side) or in the server side.
All that is defined in an Accessor object, is stored in maps accessible by
name. A part from the map used for literal substitution all is stored in maps
the values of which are DataDef
objects.
The DataDef
class comes with several methods and data structures
suited to the definition of the statements/methods/computations that it can
hold inside, and at the same time provides methods to retrieve those
implementation objects.
ParamContext
,
PostStatement
,
org.joty.workstation.gui.JotyDialog
,
org.joty.server.JotyServer
Modifier and Type | Class and Description |
---|---|
class |
Accessor.DataDef
The core inner class for the definition and the retrieving of an sql
statement capable to support context parameters, the value of which is
resolved either at the store time of the statement definition or at the
statement execution time.
|
class |
Accessor.DialogDataDef |
class |
Accessor.ExprHolder |
class |
Accessor.PanelDataDef |
static interface |
Accessor.ParamActuator
Its implementation must provide a 'way' to get a value for the context
parameter which is related to.
|
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
m_conn |
protected DbManager.DbConnectionGrabber |
m_connGrabber |
java.lang.String |
m_ddNotFoundMsg |
org.joty.common.CaselessStringKeyMap<Accessor.DialogDataDef> |
m_dialogDataDefs |
org.joty.common.ErrorCarrier |
m_errorCarrier |
protected org.joty.common.LangLiteralRetCodeMapper |
m_langLiteralRetCodeMapper |
org.joty.common.CaselessStringKeyMap<java.lang.String> |
m_literalSubsts |
protected org.joty.common.ParamContext |
m_paramContext |
protected org.joty.common.SearchQueryBuilderBack |
m_searchQueryBuilder |
boolean |
m_shared |
java.lang.String |
m_sharingKeyField |
org.joty.common.CaselessStringKeyMap<Accessor.DataDef> |
m_statementDefs |
Constructor and Description |
---|
Accessor() |
Modifier and Type | Method and Description |
---|---|
void |
clearParamContext() |
protected void |
customInit() |
boolean |
dataDefFound() |
Accessor.DataDef |
getDataDef() |
Accessor.PanelDataDef |
getPanelDataDef(PostStatement postStatement) |
Accessor.PanelDataDef |
getPanelDataDef(java.lang.String m_dialogName,
int m_panelIdxInDialog) |
org.joty.common.ParamContext |
getParamContext() |
java.lang.String |
getQueryFromPostStatement() |
java.lang.String |
getSharingAlias(Accessor.DataDef dataDef) |
java.lang.String |
getUpdatableSetFromDataDef() |
void |
init() |
void |
init(org.joty.common.JotyMessenger jotyMessanger) |
boolean |
isMissingContextParam(java.lang.String name) |
protected void |
loadDefs() |
protected void |
namer() |
java.lang.String |
paramValue(java.lang.String name) |
void |
setConn(java.sql.Connection conn) |
void |
setDbConnectionGrabber(DbManager.DbConnectionGrabber connGrabber) |
void |
setFromConfiguration(org.joty.common.ConfigFile configFile) |
void |
setLangLiteralRetCodeMapper(org.joty.common.LangLiteralRetCodeMapper mapper) |
void |
setPaginationQuery(java.lang.String query,
java.lang.String pageSize) |
void |
setPostStatement(PostStatement postStatement) |
void |
setPostStatement(PostStatement postStatement,
boolean inTransaction) |
void |
setSharingData(org.joty.common.ConfigFile configFile) |
void |
setSharingKey(java.lang.String sharingKey) |
java.lang.String |
sharingClause() |
boolean |
sharingViolation() |
boolean |
substitutingLiteral() |
public org.joty.common.ErrorCarrier m_errorCarrier
public org.joty.common.CaselessStringKeyMap<Accessor.DialogDataDef> m_dialogDataDefs
public org.joty.common.CaselessStringKeyMap<Accessor.DataDef> m_statementDefs
public org.joty.common.CaselessStringKeyMap<java.lang.String> m_literalSubsts
protected org.joty.common.ParamContext m_paramContext
protected org.joty.common.SearchQueryBuilderBack m_searchQueryBuilder
public java.lang.String m_ddNotFoundMsg
protected java.sql.Connection m_conn
public boolean m_shared
public java.lang.String m_sharingKeyField
protected DbManager.DbConnectionGrabber m_connGrabber
protected org.joty.common.LangLiteralRetCodeMapper m_langLiteralRetCodeMapper
public void init(org.joty.common.JotyMessenger jotyMessanger)
public void clearParamContext()
public boolean dataDefFound()
public Accessor.DataDef getDataDef()
public Accessor.PanelDataDef getPanelDataDef(PostStatement postStatement)
public Accessor.PanelDataDef getPanelDataDef(java.lang.String m_dialogName, int m_panelIdxInDialog)
public org.joty.common.ParamContext getParamContext()
public java.lang.String getQueryFromPostStatement()
public java.lang.String getSharingAlias(Accessor.DataDef dataDef)
public java.lang.String getUpdatableSetFromDataDef()
public void init()
public void setDbConnectionGrabber(DbManager.DbConnectionGrabber connGrabber)
protected void namer()
protected void customInit()
protected void loadDefs()
public boolean isMissingContextParam(java.lang.String name)
public java.lang.String paramValue(java.lang.String name)
public void setConn(java.sql.Connection conn)
public void setFromConfiguration(org.joty.common.ConfigFile configFile)
public void setLangLiteralRetCodeMapper(org.joty.common.LangLiteralRetCodeMapper mapper)
public void setPaginationQuery(java.lang.String query, java.lang.String pageSize)
public void setPostStatement(PostStatement postStatement)
public void setPostStatement(PostStatement postStatement, boolean inTransaction)
public void setSharingData(org.joty.common.ConfigFile configFile) throws org.joty.common.ConfigFile.ConfigException
org.joty.common.ConfigFile.ConfigException
public void setSharingKey(java.lang.String sharingKey)
public java.lang.String sharingClause()
public boolean sharingViolation()
public boolean substitutingLiteral()