|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.peer.LyRequestEncoder
leon.peer.LyBlobRequestEncoder
leon.peer.sql.LySqlRequestEncoder
public class LySqlRequestEncoder
This class is used to send requests to a SQL database connection and to receive its answers.
LyRequestEncoder
,
LySqlConnection
,
LySqlDataProvider
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static char |
CHAR_QUOTE
|
static java.lang.String |
DOMAIN_FILTER_RELATION
|
static java.lang.String |
STRING_QUOTE
|
static java.lang.String |
STRING_TWO_QUOTES
|
Fields inherited from class leon.peer.LyBlobRequestEncoder |
---|
MAX_BLOB_BUFFER |
Constructor Summary | |
---|---|
LySqlRequestEncoder(LyDataProvider provider,
LyDataSource dataSource,
java.lang.String valueSep)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
buildObject(LyUnionRequestEncoder encoder,
LyClass peerClass)
Return a new instance of the specified class. |
LySqlRequestInfo |
clearChildRequestInfo(LySqlRequestEncoder encoder)
We are noi longer the parent of the specified encoder's request info the specified encoders's request info becomes a new child of current context. |
java.lang.String |
completeSelectedFields(java.util.Vector<java.lang.String> existingFields,
LySort sort,
boolean needDistinct,
java.lang.String tableName)
Used to add a list of fields to a select request. |
java.lang.String |
completeSelectedFields(java.util.Vector<java.lang.String> existingFields,
LySortCriterion criterion,
java.lang.String tableName)
Used to add a list of fields to a select request. |
boolean |
createObject(java.lang.Object object)
To create a new object. |
boolean |
deleteObject(java.lang.Object object)
To delete an object. |
boolean |
deleteObjects(java.util.Vector<java.lang.Object> objects)
To delete an object. |
java.lang.String |
encodeLimitCondition(int limit)
encode the limit condition. |
java.util.Vector<LyFilter> |
getFilters(LyUnionBinding unionBinding)
Look for filters inside a LyUnionBinding. |
boolean |
getObject(LyObjectId objectId,
java.util.Vector<LyField> fields)
Get an object. |
java.util.Collection<LyValueSet> |
getObjects(LyUnionRequestEncoder encoder,
java.util.Vector<LyField> fields,
LySort sort,
LyFilter filter,
int n)
Get a set of objects with a join request. |
boolean |
getObjects(java.util.Vector<LyField> fields,
LySort sort,
LyFilter filter,
int n)
Get a set of objects. |
LySqlRequestInfo |
getRequestInfo()
Get or create the request info : this is the context for aliases and encoding info to generate the request. |
boolean |
getSize(LyFilter filter)
Return the number of objects from the data provider . |
java.lang.Integer |
getSize(LyUnionRequestEncoder encoder,
LyFilter filter)
Return the number of objects from the data provider with a join request. |
java.lang.String |
getSQLFormatDate(java.lang.String quotedId,
LyDateFieldInfo fieldInfo)
String force formating date for order by using FORMAT(quotedId, 'YYYY-MM-DD HH:MM:SS') but syntax is specific depending on database vendor. |
java.lang.String |
getTableAliasForSelfTargetRelationClass(java.lang.String domain,
LyClassInfo classInfo,
LyFieldInfo fieldInfo,
java.lang.String tableName)
Search for the table alias of a given table for a given logical class class and target class on the case of a self (class and target class identical) pointing relation |
LySqlRequestInfo |
setChildRequestInfo(LySqlRequestEncoder encoder,
LySqlRequestInfo.Join childType)
Transfer the request info to the specified encoder the specified encoders's request info becomes a new child of current context. |
boolean |
setObject(java.lang.Object object)
To set an object. |
boolean |
setObjects(java.util.Vector<java.lang.Object> objects)
To set a set of objects. |
void |
setResponse(LyResponse response)
Set the request encoder response. |
void |
setTrim(boolean trim)
|
boolean |
supportCaseSensitive()
Returns a boolean that indicates if case sensitive is supported. |
Methods inherited from class leon.peer.LyBlobRequestEncoder |
---|
getBlobContent |
Methods inherited from class leon.peer.LyRequestEncoder |
---|
getClassBinding, getDataClass, getProvider, getResponse, isSynchronous, loadObject, setClassBinding, setDataClass, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final java.lang.String DOMAIN_FILTER_RELATION
public static final char CHAR_QUOTE
public static final java.lang.String STRING_QUOTE
public static final java.lang.String STRING_TWO_QUOTES
Constructor Detail |
---|
public LySqlRequestEncoder(LyDataProvider provider, LyDataSource dataSource, java.lang.String valueSep)
provider
- dataSource
- valueSep
- Method Detail |
---|
public void setTrim(boolean trim)
public void setResponse(LyResponse response)
setResponse
in class LyRequestEncoder
the
- responsepublic boolean getObject(LyObjectId objectId, java.util.Vector<LyField> fields)
getObject
in class LyRequestEncoder
objectId
- object identifierfields
- the fields to load (if null, load all)
public java.util.Collection<LyValueSet> getObjects(LyUnionRequestEncoder encoder, java.util.Vector<LyField> fields, LySort sort, LyFilter filter, int n)
getObjects
in interface LyJoinRequestEncoder
encoder
- the asking union encoder.fields
- the fields to load (if null, load all)sort
- indicates sorting criterion, or null if default sort is used.filter
- indicates filtering criterion, or null if there is no filter.n
- maximum number of objects to get.
public boolean getObjects(java.util.Vector<LyField> fields, LySort sort, LyFilter filter, int n)
getObjects
in class LyRequestEncoder
fields
- the fields to load (if null, load all)sort
- indicates sorting criterion, or null if default sort is used.filter
- indicates filtering criterion, or null if there is no filter.n
- maximum number of objects to get.
public java.lang.Integer getSize(LyUnionRequestEncoder encoder, LyFilter filter)
getSize
in interface LyJoinRequestEncoder
encoder
- The union encoder demanding the number of the objects.filter
- indicates filtering criterion, or null if there is no filter.
public boolean getSize(LyFilter filter)
getSize
in class LyRequestEncoder
filter
- indicates filtering criterion, or null if there is no filter.
public boolean deleteObject(java.lang.Object object)
deleteObject
in class LyRequestEncoder
object
- the object to delete
public boolean deleteObjects(java.util.Vector<java.lang.Object> objects)
deleteObjects
in class LyRequestEncoder
object
- the object to delete
public boolean createObject(java.lang.Object object)
createObject
in class LyRequestEncoder
values
- the values of the new object
public boolean setObject(java.lang.Object object)
setObject
in class LyRequestEncoder
object
- the object to setvalues
- the new values of the object
public boolean setObjects(java.util.Vector<java.lang.Object> objects)
setObjects
in class LyRequestEncoder
objects
- the objects to setvalues
- the new values of the objects
public java.lang.String completeSelectedFields(java.util.Vector<java.lang.String> existingFields, LySort sort, boolean needDistinct, java.lang.String tableName)
sort
- The sort of the requestneedDistinct
- Indicates if a need distinct clause is in the select request.tableName
- The table name
public java.lang.String completeSelectedFields(java.util.Vector<java.lang.String> existingFields, LySortCriterion criterion, java.lang.String tableName)
criterion
- The sort criterion of the requesttableName
- The table name
public java.util.Vector<LyFilter> getFilters(LyUnionBinding unionBinding)
unionBinding
- current binding
public java.lang.String getSQLFormatDate(java.lang.String quotedId, LyDateFieldInfo fieldInfo)
quotedId
- id of the date field (using aliases, table names and quotes if needed)peerField
- peer field related to this columnpublic java.lang.String getTableAliasForSelfTargetRelationClass(java.lang.String domain, LyClassInfo classInfo, LyFieldInfo fieldInfo, java.lang.String tableName)
classInfo
- target logical classfieldInfo
- optional parameter to search the alias name in the context of this
fieldInfotableName
- table name
public boolean supportCaseSensitive()
public java.lang.Object buildObject(LyUnionRequestEncoder encoder, LyClass peerClass)
buildObject
in interface LyJoinRequestEncoder
peerClass
- the physical class of the created object.encoder
- The union encoder demanding the creation
public LySqlRequestInfo getRequestInfo()
public LySqlRequestInfo setChildRequestInfo(LySqlRequestEncoder encoder, LySqlRequestInfo.Join childType)
encoder
- target encoderchildType
- the type of child, one of the TYPE_xxx constants. parameter is ignored when
parent is null.public LySqlRequestInfo clearChildRequestInfo(LySqlRequestEncoder encoder)
encoder
- target encoderpublic java.lang.String encodeLimitCondition(int limit)
limit
- max numbut of rows fetched
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |