DEPRECATED
Object
A class which generate and execute SQL based upon the reference document management implementation.
Object
RefSQLGenerator
Nested Class Summary |
public static class | com.bea.p13n.content.document.ref.RefSQLGenerator.Info
The generated SQL and information about the Search. |
Field Summary |
public static final short |
|
public static final short |
|
public static final short |
|
public static final |
|
public static final |
|
public static final |
|
public |
|
public |
|
public static final short |
|
public boolean |
|
public static final short |
|
public static final short |
|
public static final |
|
public static final short |
|
public static final short |
|
public static final short |
|
public static final short |
|
public static final short |
|
public static final short |
|
public |
|
public |
|
public boolean |
|
Constructor Summary |
Method Summary |
protected void |
|
protected |
|
protected void |
|
protected void |
|
public |
|
public short |
|
protected static |
|
protected static |
|
public |
|
public |
|
protected static |
|
public boolean |
|
public |
|
public void |
|
public | |
public | |
public | |
public |
Methods from class java.lang. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final short AND_TYPE
Related Topics
public static final short COLLECTION_CONTAINS_ALL_TYPE
Related Topics
public static final short COLLECTION_CONTAINS_TYPE
Related Topics
public static final DateFormat
dateFormat
public static final Map
defPropertyColumnMap
public static final Map
defPropertyTypeMap
public String
docMDTable
Set this to null for this to only handle explicit properties. In
this case, if a property is found that is not in the
RefSQLGenerator.propertyColumnMap
, this will either produce SQL that will never
match (if
RefSQLGenerator.failOnNonExplicit
is false) or throw an exception (if
RefSQLGenerator.failOnNonExplicit
is true).
Related Topics
public String
docTable
Related Topics
public static final short EQUALS_TYPE
Related Topics
public boolean failOnNonExplicit
RefSQLGenerator.docMDTable
is null and a property is
found that isn't in RefSQLGenerator.propertyColumnMap
.
If this is true, an exception will be thrown; otherwise, SQL that will never match any document will be generated (default).
public static final short GREATER_OR_EQUALS_TYPE
Related Topics
public static final short GREATER_THAN_TYPE
Related Topics
public static final com.bea.p13n.content.document.ref.RefSQLGenerator
instance
This can be used to access any of the default utility method implementations:
Those methods exist as instance methods to allow for subclasses to override behavior.public static final short LESS_OR_EQUALS_TYPE
Related Topics
public static final short LESS_THAN_TYPE
Related Topics
public static final short LIKE_TYPE
Related Topics
public static final short NOT_EQUALS_TYPE
Related Topics
public static final short NOT_TYPE
Related Topics
public static final short OR_TYPE
Related Topics
public Map
propertyColumnMap
If the property name from the expression is in this map, then the
associated value will be the document
table column
name in the resulting SQL statement. If the property name is not in
this map, then it is assumed the property is from the
document_metadata
table (unless
RefSQLGenerator.docMDTable
is set null, in which case an exception is
raised). For example, if the property name is "identifier" and the
associated value in the map is "ID", then all expressions written
against "identifier" will get converted into SQL statements againsts
the "ID" column of the
document
table.
public Map
propertyTypeMap
If the property name from the expression is in propertyColumnMap, it
also needs to be in this map. The associated value is the Class object
minimum type that the literal in the expression being compared to the
property must have. For example, if the property name "size" is mapped
to the "DOCUMENT_SIZE" column in RefSQLGenerator.propertyColumnMap
and mapped
to
Number.class
here, then, in the expression, all
comparisions to "size" must be against numbers (e.g. "size != 1024",
"size < 10000.0").
public boolean sortExplicitOnly
Explicit properties are those that are mapped to
document
table columns in
RefSQLGenerator.propertyColumnMap
.
If the sortBy of a Search contains a non-explicit property reference
and
RefSQLGenerator.docMDTable
is not null, this will control what happens. If
this is false (the default), then the SortCriteria will be assigned to
the Info instance and no database level sorting will occur;
something else should handle the sorting (the
RefSQLGenerator.sort(List, RefSQLGenerator.Info)
method can
be used to sort a List of DocumentMetadataDefs). If this is
true, then the property will be skipped for the sort and all sorting
will occur in the database.
Constructor Detail |
public RefSQLGenerator()
Method Detail |
protected void createBranchInfo(Utility to convert a branch expression into a SQL expression.StringBuffer
buf,Expression
expr,List
params, boolean supportsLikeEscapeClause)
throwsDocumentException
DocumentException
protectedUtility method to convert an Expression into a SQL expression.String
createInfo(Expression
expr,List
params, boolean supportsLikeEscapeClause)
throwsDocumentException
DocumentException
protected void createInfo(Utility method to convert an Expression into a SQL expression.StringBuffer
buf,Expression
expr,List
params, boolean supportsLikeEscapeClause)
throwsDocumentException
DocumentException
protected void createLeafInfo(Utility to convert a valid leaf Expression into a SQL expression.StringBuffer
buf,Expression
expr,List
params, boolean supportsLikeEscapeClause)
throwsDocumentException
DocumentException
publicGet the expression string for the specified expression type.String
getExpressionString(short type)
throwsDocumentException
DocumentException
Related Topics
RefSQLGenerator.NOT_EQUALS_TYPE
RefSQLGenerator.EQUALS_TYPE
RefSQLGenerator.GREATER_THAN_TYPE
RefSQLGenerator.LESS_THAN_TYPE
RefSQLGenerator.GREATER_OR_EQUALS_TYPE
RefSQLGenerator.LESS_OR_EQUALS_TYPE
RefSQLGenerator.LIKE_TYPE
RefSQLGenerator.COLLECTION_CONTAINS_TYPE
RefSQLGenerator.COLLECTION_CONTAINS_ALL_TYPE
RefSQLGenerator.AND_TYPE
RefSQLGenerator.OR_TYPE
RefSQLGenerator.NOT_TYPE
public short getExpressionType(Get a type constant for the given expression.Expression
expr)
throwsDocumentException
DocumentException
Related Topics
RefSQLGenerator.NOT_EQUALS_TYPE
RefSQLGenerator.EQUALS_TYPE
RefSQLGenerator.GREATER_THAN_TYPE
RefSQLGenerator.LESS_THAN_TYPE
RefSQLGenerator.GREATER_OR_EQUALS_TYPE
RefSQLGenerator.LESS_OR_EQUALS_TYPE
RefSQLGenerator.LIKE_TYPE
RefSQLGenerator.COLLECTION_CONTAINS_TYPE
RefSQLGenerator.COLLECTION_CONTAINS_ALL_TYPE
RefSQLGenerator.AND_TYPE
RefSQLGenerator.OR_TYPE
RefSQLGenerator.NOT_TYPE
protected staticGet the left-hand-side of an expression.PropertyRef
getLeftHandSide(Expression
expr)
throwsDocumentException
DocumentException
Related Topics
ExpressionHelper.getLeftHandSide(Expression)
protected staticGet the right-hand-side of an expression.Object
getRightHandSide(Expression
expr)
throwsDocumentException
DocumentException
Related Topics
ExpressionHelper.getRightHandSide(Expression)
publicUtility method to get an Info object from the Search params.RefSQLGenerator.Info
getSearchInfo(String
baseSql,Search
params, boolean supportsLikeEscapeClause)
throwsDocumentException
DocumentException
publicReturn the corresponding SQL operator for the given expression type.String
getSQLOperator(short type)
throwsDocumentException
DocumentException
protected staticGet the specified subexpression.Expression
getSubExpression(Expression
expr, int count)
throwsDocumentException
DocumentException
Related Topics
ExpressionHelper.getSubExpression(Expression, int)
public boolean isLegalSingleValueExpressionType(short type)Determine if a comparator is legal, single-value attribute comparator.
publicPrepare a JDBC statement from the specified information on the given database connection.PreparedStatement
prepare(Connection
con,RefSQLGenerator.Info
info)
throwsSQLException
SQLException
public void sort(Sort a list of DocumentMetadataDefs based upon the info's sort criteria.List
list,RefSQLGenerator.Info
info)
throwsDocumentException
DocumentException
publicConvert a query LIKE value to a SQL LIKE value.String
toSQLLike(String
like, boolean patternMatchIgnoreCase, boolean supportsLikeEscapeClause)
publicConvert a query LIKE value to a SQL LIKE value.String
toSQLLike(String
like, boolean supportsLikeEscapeClause)
publicConvert an object, which might be a string, to a SQL like string.Object
toSQLLike(Object
obj, boolean patternMatchIgnoreCase, boolean supportsLikeEscapeClause)
publicConvert an object, which might be a string, to a SQL like string.Object
toSQLLike(Object
obj, boolean supportsLikeEscapeClause)