|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.rview.RelationalView
public abstract class RelationalView
A RelationalView comprises two parts:
The methods in a RelationalView provide a means for accessing the rows of the RelationalView using Java beans as the mechanism for passing in row information, or for retrieving row information. All methods in the RelationalView act only on the rows represented by the RelationalView. The insert methods are the notable exceptions, where rows inserted through this interface may or may not appear as part of the row subset encompassed by the RelationalView.
A RelationalView can also provide subviews which are themselves RelationalViews that contain subsets of the rows contained by the parent RelationalView. Subviews may be obtained by providing explicit property conditions, or by selecting a named, parameterized subview.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Constructor Summary | |
---|---|
RelationalView()
|
Method Summary | |
---|---|
abstract RelationalView |
createSubview(java.util.Dictionary pConstraints)
Returns a subview filtered by the given Dictionary. |
abstract RelationalView |
createSubview(java.util.Dictionary pConstraints,
java.lang.String pWhereClause,
java.lang.Object[] pWhereClauseParameters,
java.lang.String pOrderByClause,
java.lang.Object[] pOrderByClauseParameters)
This is the same the general createSubview method, except that the value of the distinct flag is taken from the value of this RelationalView's distinct flag. |
abstract RelationalView |
createSubview(java.util.Dictionary pConstraints,
java.lang.String pWhereClause,
java.lang.Object[] pWhereClauseParameters,
java.lang.String pOrderByClause,
java.lang.Object[] pOrderByClauseParameters,
boolean pDistinct)
This is the most general method for creating a subview at runtime (i.e., a subview that has not been predefined in the description file). |
abstract int |
delete()
Deletes all of the rows in the RelationalView. |
abstract java.lang.Object |
executeFunction(java.lang.String pFunctionName)
Executes a predefined function, identified by name. |
abstract java.lang.Object |
executeFunction(java.lang.String pFunctionName,
java.lang.Object pFunctionParameter)
Executes a predefined function, identified by name. |
abstract java.lang.Object |
executeFunction(java.lang.String pFunctionName,
java.lang.Object[] pFunctionParameters)
Executes a predefined function, identified by name. |
abstract java.lang.Class |
getBeanClass()
Returns the Class of the bean used to represent the rows handled by this RelationalView. |
abstract RelationalViewDefinition |
getRelationalViewDefinition()
Returns the RelationalViewDefinition that defines this RelationalView and all of its subviews (i.e., subviews of this RelationalView will return the same RelationalViewDefinition). |
abstract RelationalViewManager |
getRelationalViewManager()
Returns the RelationalViewManager that produced this RelationalView. |
abstract RelationalView |
getSubview(java.lang.String pSubviewName)
Returns a pre-defined subview identified by name. |
abstract RelationalView |
getSubview(java.lang.String pSubviewName,
java.lang.Object pSubviewParameter)
Returns a pre-defined subview identified by name. |
abstract RelationalView |
getSubview(java.lang.String pSubviewName,
java.lang.Object[] pSubviewParameters)
Returns a pre-defined subview identified by name. |
abstract RelationalView |
getUncachedRelationalView()
Returns a RelationalView that is identical to this RelationalView, except that all of its select calls bypass the caches and go directly to the database. |
abstract int |
insert(java.util.Dictionary pPropertyValues)
Inserts a row into the RelationalView. |
abstract int |
insert(java.lang.Object pBean)
Inserts a row into the RelationalView. |
abstract int |
insert(java.lang.Object[] pBeans)
Inserts several rows into the RelationalView. |
abstract int |
insert(java.lang.Object[] pBeans,
java.lang.String[] pPropertyNames)
Inserts several rows into the RelationalView. |
abstract int |
insert(java.lang.Object pBean,
java.lang.String[] pPropertyNames)
Inserts a row into the RelationalView. |
abstract void |
invalidateCaches()
Invalidate any caches that depend on the relational view. |
abstract java.lang.Object[] |
select()
Returns an array of all the rows in the RelationalView, in order, where each row has been converted into a bean according to the RelationalView's row-to-bean mapping. |
abstract java.lang.Object |
select(int pIndex)
Returns the row specified by the given index (the first row has index 0). |
abstract java.lang.Object[] |
select(int pIndex,
int pCount)
Returns up to the specified number of rows starting with the given index (the first row has index 0). |
abstract int |
selectCount()
Returns the number of rows in the RelationalView. |
abstract boolean |
selectExists()
Returns true if there are any rows in the RelationalView, false if not. |
abstract java.lang.Object |
selectFirst()
Returns the first row in the RelationalView. |
abstract int |
update(java.util.Dictionary pPropertyValues)
Updates all of the rows in the RelationalView. |
abstract int |
update(java.lang.Object pBean)
Updates all of the rows in the RelationalView, setting their columns from the properties of the specified bean. |
abstract int |
update(java.lang.Object pBean,
java.lang.String[] pPropertyNames)
Updates all of the rows in the RelationalView, setting their columns from the properties of the specified bean. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public RelationalView()
Method Detail |
---|
public abstract RelationalViewManager getRelationalViewManager()
public abstract RelationalViewDefinition getRelationalViewDefinition()
public abstract java.lang.Class getBeanClass()
public abstract int insert(java.lang.Object pBean) throws java.sql.SQLException
pBean
- the bean whose properties are to be inserted into
the row's columns. The bean's class must match the type of bean
associated with this RelationalView.
java.sql.SQLException
- if a database error occurredpublic abstract int insert(java.lang.Object pBean, java.lang.String[] pPropertyNames) throws java.sql.SQLException
pBean
- the bean whose properties are to be inserted into
the row's columns. The bean's class must match the type of bean
associated with this RelationalView.pPropertyNames
- the list of properties whose columns are to
be set. Any properties not named in this list will not have
their corresponding columns assigned values. This can be used to
allow columns to take on the default values specified by the
database.
java.sql.SQLException
- if a database error occurredpublic abstract int insert(java.lang.Object[] pBeans) throws java.sql.SQLException
pBeans
- the array of beans whose properties are to be
inserted into the row's columns. The bean's class must match the
type of bean associated with this RelationalView.
java.sql.SQLException
- if a database error occurredpublic abstract int insert(java.lang.Object[] pBeans, java.lang.String[] pPropertyNames) throws java.sql.SQLException
pBeans
- the array of beans whose properties are to be
inserted into the row's columns. The bean's class must match the
type of bean associated with this RelationalView.pPropertyNames
- the list of properties whose columns are to
be set. Any properties not named in this list will not have
their corresponding columns assigned values. This can be used to
allow columns to take on the default values specified by the
database.
java.sql.SQLException
- if a database error occurredpublic abstract int insert(java.util.Dictionary pPropertyValues) throws java.sql.SQLException
pPropertyValues
- a mapping of property names to their
corresponding values to be inserted into the row.
java.sql.SQLException
- if a database error occurredpublic abstract int delete() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract int update(java.lang.Object pBean) throws java.sql.SQLException
pBean
- the bean whose properties are to be updated into the
rows' columns. The bean's class must match the type of bean
associated with this RelationalView.
java.sql.SQLException
- if a database error occurredpublic abstract int update(java.lang.Object pBean, java.lang.String[] pPropertyNames) throws java.sql.SQLException
pBean
- the bean whose properties are to be updated into the
rows' columns. The bean's class must match the type of bean
associated with this RelationalView.pPropertyNames
- the list of properties whose columns are to
be set. Any properties not named in this list will not have
their corresponding columns assigned values. This can be used to
prevent certain columns from being modified.
java.sql.SQLException
- if a database error occurredpublic abstract int update(java.util.Dictionary pPropertyValues) throws java.sql.SQLException
pPropertyValues
- a mapping of property names to their
corresponding values to be updated into the row.
java.sql.SQLException
- if a database error occurredpublic abstract java.lang.Object[] select() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract java.lang.Object select(int pIndex) throws java.sql.SQLException
pIndex
- the index number of the row to be returned (0 is
the first row)
java.sql.SQLException
- if a database error occurredpublic abstract java.lang.Object selectFirst() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract java.lang.Object[] select(int pIndex, int pCount) throws java.sql.SQLException
pIndex
- the index number of the row to be returned (0 is
the first row)pCount
- the maximum number of rows to be returned
java.sql.SQLException
- if a database error occurredpublic abstract int selectCount() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract boolean selectExists() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract RelationalView createSubview(java.util.Dictionary pConstraints, java.lang.String pWhereClause, java.lang.Object[] pWhereClauseParameters, java.lang.String pOrderByClause, java.lang.Object[] pOrderByClauseParameters, boolean pDistinct) throws java.sql.SQLException
pConstraints
- a Dictionary containing the constraints for
the subview. The Dictionary's keys are the names of properties,
and the values are values corresponding to those properties. The
resulting RelationalView will contain only those rows where the
columns corresponding to the specified properties contain the
values corresponding the values specified in the Dictionary. If
this argument is null, then it is ignored.pWhereClause
- this is a WHERE clause written in SQL. All
column and table names should be written in terms of relational
views using the ":" syntax. All literal values should be passed
as parameters in pWhereClauseParameters and referred to using ":"
syntax. The clause should not include the actual "WHERE"
keyword. For example: ":this.age >= :0(INTEGER)". If this
argument is null, then it is ignored.pWhereClauseParameters
- these are the parameters to the
WHERE clause, as referred to using the ":" syntax. For example,
":0" would refer to the first element in this parameter list. If
there are no parameters, or there is no WHERE clause, this
argument may be left as null.pOrderByClause
- this is an ORDER BY clause written in SQL.
All column and table names should be written in terms of
relational views using the ":" syntax. All literal values should
be passed as parameters in pOrderByClauseParameters and referred
to using ":" syntax. The clause should not include the
actual "ORDER BY" keywords. For example: ":this.name, :this.age
desc". If this argument is null, then it is ignored.pOrderByClauseParameters
- these are the parameters to the
ORDER BY clause, as referred to using the ":" syntax. For
example, ":0" would refer to the first element in this parameter
list. If there are no parameters, or there is no ORDER BY
clause, this argument may be left as null.pDistinct
- if true, then the SELECT statements for this
subview will be generated using the DISTINCT keyword. Otherwise,
the DISTINCT keyword will not be used.
java.sql.SQLException
- if a database error occurred, or if an
unknown property name was included in the Dictionarypublic abstract RelationalView createSubview(java.util.Dictionary pConstraints, java.lang.String pWhereClause, java.lang.Object[] pWhereClauseParameters, java.lang.String pOrderByClause, java.lang.Object[] pOrderByClauseParameters) throws java.sql.SQLException
java.sql.SQLException
- if a database error occurred, or if an
unknown property name was included in the Dictionarypublic abstract RelationalView createSubview(java.util.Dictionary pConstraints) throws java.sql.SQLException
java.sql.SQLException
- if a database error occurred, or if an
unknown property name was included in the Dictionarypublic abstract RelationalView getSubview(java.lang.String pSubviewName, java.lang.Object[] pSubviewParameters) throws java.sql.SQLException
pSubviewName
- the name of the pre-defined subviewpSubviewParameters
- the list of parameters to be associated
with the subview
java.sql.SQLException
- if a database error occurred, the
specified subview name is not defined, or if the subview's
parameters are incorrectly specified (wrong number or type).public abstract RelationalView getSubview(java.lang.String pSubviewName, java.lang.Object pSubviewParameter) throws java.sql.SQLException
pSubviewName
- the name of the pre-defined subviewpSubviewParameter
- the parameter to be associated with the
subview
java.sql.SQLException
- if a database error occurred, the
specified subview name is not defined, or if the subview's
parameters are incorrectly specified (wrong number or type).public abstract RelationalView getSubview(java.lang.String pSubviewName) throws java.sql.SQLException
pSubviewName
- the name of the pre-defined subview
java.sql.SQLException
- if a database error occurred, the
specified subview name is not defined, or if the subview's
parameters are incorrectly specified (wrong number or type).public abstract java.lang.Object executeFunction(java.lang.String pFunctionName, java.lang.Object[] pFunctionParameters) throws java.sql.SQLException
pFunctionName
- the name of the pre-defined functionpFunctionParameters
- the list of parameters to be
passed to the function
java.sql.SQLException
- if a database error occurred, the
specified function name is not defined, or if the function's
parameters are incorrectly specified (wrong number or type).public abstract java.lang.Object executeFunction(java.lang.String pFunctionName, java.lang.Object pFunctionParameter) throws java.sql.SQLException
pFunctionName
- the name of the pre-defined functionpFunctionParameter
- the parameter to be passed to the
function
java.sql.SQLException
- if a database error occurred, the
specified function name is not defined, or if the function's
parameters are incorrectly specified (wrong number or type).public abstract java.lang.Object executeFunction(java.lang.String pFunctionName) throws java.sql.SQLException
pFunctionName
- the name of the pre-defined function
java.sql.SQLException
- if a database error occurred, the
specified function name is not defined, or if the function's
parameters are incorrectly specified (wrong number or type).public abstract RelationalView getUncachedRelationalView() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurredpublic abstract void invalidateCaches()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |