|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectflex.data.assemblers.AbstractAssembler
flex.data.assemblers.SQLAssembler
public class SQLAssembler
| Field Summary | |
|---|---|
static String |
LOG_CATEGORY
Log category for SQLAssembler. |
| Fields inherited from interface flex.data.assemblers.SQLAssemblerConstants |
|---|
COUNT, CREATE_ITEM, DATABASE, DATASOURCE, DELETE_ITEM, DRIVER_CLASS, DRIVER_PASSWORD, DRIVER_URL, DRIVER_USER, FILL, GET_ITEM, ID_QUERY, LOGIN_TIMEOUT, PROCEDURE_NAME, PROCEDURE_PARAM, PROCEDURE_TYPE, PROPERTY_VALUE, QUERY_NAME, SQL, SQL_PROCEDURE, UPDATE_ITEM |
| Fields inherited from interface flex.data.assemblers.Assembler |
|---|
APPEND_TO_FILL, DO_NOT_EXECUTE_FILL, EXECUTE_FILL, REMOVE_FROM_FILL |
| Constructor Summary | |
|---|---|
SQLAssembler()
Default constructor for SQLAssembler. |
|
| Method Summary | |
|---|---|
void |
addCountProcedure(flex.data.config.NamedSQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during count. |
void |
addCountSQL(flex.data.config.NamedSQLSettings sqlSettings)
The method is used for dynamically adding a sql statement for execution during count. |
void |
addFillProcedure(flex.data.config.NamedSQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during fill. |
void |
addFillSQL(flex.data.config.NamedSQLSettings sqlSettings)
The method is used for dynamically adding a sql statement for execution during fill. |
boolean |
autoRefreshFill(List fillParams)
This returns false because we always push refresh fill methods for this sample. |
int |
count(List countParameters)
Retrieve the number of items for a given query with the supplied parameters. |
void |
createItem(Object createItem)
Creates the item. |
void |
deleteItem(Object deleteItem)
This is called when the client application removes an item managed by the destination corresponding to this assembler. |
Collection |
fill(List fillParameters)
The first fill parameter is the name of the fill query to execute. |
String |
getActionscriptClass()
Returns actionscript-class property. |
Map |
getCountSQLStructure()
Returns the sql statements for count. |
List |
getCreateItemSQL()
Returns the sql statements for create-item. |
flex.data.config.DatabaseDriverSettings |
getDatabaseDriverSettings()
Gets the DatabaseDriverSettings property. |
flex.data.config.DatasourceSettings |
getDatasourceSettings()
Gets the DatasourceSettings property. |
flex.data.assemblers.SQLFactory.SQL |
getDeleteItemSQLStructure()
Returns the sql statement for delete-item. |
Map |
getFillSQLStructure()
Returns the sql statements for fill. |
flex.data.assemblers.SQLFactory.SQL |
getGetItemSQLStructure()
Returns the sql statements for get-item. |
Object |
getItem(Map m)
Retrieves an item with the specified Map of ids. |
String |
getJavaClass()
Returns java-class property. |
void |
initialize(String id,
ConfigMap properties)
This initialize method is called once for each destination. |
void |
removeCountSQL(String name)
The method is used for dynamically removing a sql statement for count. |
void |
removeFillSQL(String name)
The method is used for dynamically removing a sql statement for fill. |
void |
setActionscriptClass(String actionscriptClass)
Sets actionscript-class property. |
void |
setCreateItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during createItem. |
void |
setCreateItemSQL(String sql,
String idQuery,
boolean processIdQueryFirst)
The method is used for dynamically adding a sql statement for executing during getItem. |
void |
setDatabaseDriverSettings(flex.data.config.DatabaseDriverSettings ds)
Sets the DatabaseDriverSettings property. |
void |
setDatasourceSettings(flex.data.config.DatasourceSettings ds)
Sets the DatasourceSettings property. |
void |
setDeleteItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during deleteItem. |
void |
setDeleteItemSQL(String sql)
Sets the sql statement for delete-item. |
void |
setGetItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during getItem. |
void |
setGetItemSQL(String sql)
Sets the sql statement for get-item. |
void |
setJavaClass(String javaClass)
Sets java-class property. |
void |
setUpdateItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
The method is used for dynamically adding a procedure call for execution during updateItem. |
void |
setUpdateItemSQL(String sql)
The method is used for dynamically adding a sql statement for execution during updateItem. |
void |
start()
Starts the SQLAssembler. |
void |
stop()
Stops the SQLAssembler. |
void |
updateItem(Object newVersion,
Object prevVersion,
List changes)
Updates the item. |
| Methods inherited from class flex.data.assemblers.AbstractAssembler |
|---|
addItemToFill, fill, getItems, isStarted, refreshFill, refreshFillStatusToName, removeItemFromFill, useFillPage |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOG_CATEGORY
SQLAssembler.
| Constructor Detail |
|---|
public SQLAssembler()
SQLAssembler.
| Method Detail |
|---|
public void initialize(String id,
ConfigMap properties)
The hibernate assembler uses two utility classes. The HibernateManager is a class which is created for each hibernate configuration file you specify. It manages the Data Management Services state for a group of related hibernate entitites. The HibernateType class is created for each assembler instance.
initialize in interface FlexConfigurableinitialize in class AbstractAssemblerid - the destination name for this assembler.properties - the properties used to configure this destination underneath
the properties tag.public void start()
SQLAssembler.
start in interface FlexComponentstart in class AbstractAssemblerpublic void stop()
SQLAssembler.
stop in interface FlexComponentstop in class AbstractAssemblerpublic flex.data.config.DatasourceSettings getDatasourceSettings()
DatasourceSettings property.
public void setDatasourceSettings(flex.data.config.DatasourceSettings ds)
DatasourceSettings property.
ds - public flex.data.config.DatabaseDriverSettings getDatabaseDriverSettings()
DatabaseDriverSettings property.
public void setDatabaseDriverSettings(flex.data.config.DatabaseDriverSettings ds)
DatabaseDriverSettings property.
ds - public String getActionscriptClass()
actionscript-class property.
public void setActionscriptClass(String actionscriptClass)
actionscript-class property.
Specify an ActionScript class name for the strongly typed objects returned by the fill and getItem.
In order for the client to receive strongly typed objects from the fill and getItem
operations, the return class must be specified by either actionscript-class or java-class.
In either case, the fields returned from the SQL should match the property names for the Object.
In both cases, a RemoteClass metadata is required. The RemoteClass metadata on an ActionScript
class is an indicator that the class can be used in serialization from the server.
A map of these classes is built up where the key is equal to the string specified in the alias.
If no alias is specified, the ActionScript class name is used instead.
During serialization from the server,the map is checked and the appropriate type returned.
If you have an existing ActionScript type with a [RemoteClass(alias=server.javaClass)] metadata
designation, use java-class pointing to the same server-side class as the alias specifies.
In this case, the RemoteClass map is using the Java class as the key. Using java-class appropriately
sets the type so that the ActionScript type may be found in the RemoteClass map during serialization
to the client.
actionscriptClass - The ActionScript class name for the strongly type object returned.public String getJavaClass()
java-class property.
public void setJavaClass(String javaClass)
java-class property.
Specify a Java class name that is an alias of the strongly typed objects returned by the fill and getItem.
Refer to the javadoc ActionScript class for a detailed explanation.
javaClass - The java class name pointing to the server-side classSQLAssembler.setActionscriptClass(java.lang.String)public Map getFillSQLStructure()
public void addFillSQL(flex.data.config.NamedSQLSettings sqlSettings)
sqlSettings - Settings for the sql statement.public void addFillProcedure(flex.data.config.NamedSQLProcedureSettings sqlSettings)
public void removeFillSQL(String name)
name - Name of the sql statement.public void addCountSQL(flex.data.config.NamedSQLSettings sqlSettings)
sqlSettings - Settings for the sql statement.public Map getCountSQLStructure()
public void addCountProcedure(flex.data.config.NamedSQLProcedureSettings sqlSettings)
sqlSettings - The SQLProcedureSettings object representing the procedure configuration.SQLAssembler.addFillProcedure(NamedSQLProcedureSettings sqlSettings);public void removeCountSQL(String name)
name - Name of the sql statement.public flex.data.assemblers.SQLFactory.SQL getGetItemSQLStructure()
public void setGetItemSQL(String sql)
sql - statement for get-item.public List getCreateItemSQL()
public void setGetItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
sqlSettings - The SQLProcedureSettings object representing the procedure configuration.
public void setCreateItemSQL(String sql,
String idQuery,
boolean processIdQueryFirst)
sql - idQuery - processIdQueryFirst - public void setCreateItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
sqlSettings - The SQLProcedureSettings object representing the procedure configuration.public flex.data.assemblers.SQLFactory.SQL getDeleteItemSQLStructure()
public void setDeleteItemSQL(String sql)
public void setDeleteItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
sqlSettings - The SQLProcedureSettings object representing the procedure configuration.public void setUpdateItemSQL(String sql)
sql - statement for update-item.public void setUpdateItemProcedure(flex.data.config.SQLProcedureSettings sqlSettings)
sqlSettings - The SQLProcedureSettings object representing the procedure configuration.public int count(List countParameters)
AbstractAssemblerThis default implementation throws an error indicating that a count method for the supplied parameters is not defined.
When paging is enabled and this method is defined to return -1 , the client will be sent the number of records for the given query dynamically with each page request. This allows you to avoid an expensive count query for large data sets. *
count in interface Assemblercount in class AbstractAssemblercountParameters - a list of parameters to the count method provided by the
client invocation.
public void createItem(Object createItem)
AbstractAssemblerThe Java class of the item supplied depends on the ActionScript class used by your client application. ActionScript to Java rules are by default used to convert the client object into a Java object. This will produce a java.util.Map for the item parameter if the client object is dynamic object or if that object does not have a RemoteClass alias mapping it to a Java class. If your assembler expects instances of a single specific Java class, you can use the item-class tag in your destination's configuration to specify a single class of which all java.util.Map instances are converted into before being passed to the assembler.
createItem in interface AssemblercreateItem in class AbstractAssemblercreateItem - the initial instance of the item to create.public void deleteItem(Object deleteItem)
AbstractAssemblerThis method can also thrown any runtime exception to indicate a general error to be returned to the client.
deleteItem in interface AssemblerdeleteItem in class AbstractAssemblerdeleteItem - the original version of the item on the client which
the client intends to removepublic Collection fill(List fillParameters)
fill in interface Assemblerfill in class AbstractAssemblerfillParameters -
public Object getItem(Map m)
AbstractAssembler
getItem in interface AssemblergetItem in class AbstractAssemblerm - a java.util.Map which contains key/value pairs for
each identity property.
public void updateItem(Object newVersion,
Object prevVersion,
List changes)
AbstractAssemblerThe changes array provides the list of properties changed. You should interpret a null value as "any properties may have changed". If you have a property which has its own properties, only the top level property name will be included.
If the previousVersion conflicts with the current database copy of the item, you can throw a flex.data.DataSyncException to indicate this fact. In this case, you should provide the current version of the item in the database as the serverVersion parameter. This allows the client to resolve the conflict and resubmit a non-conflicting change or revert to the server's version. Your method can also throw any runtime exception to indicate that a general fault has occurred while processing this update.
Your updateItem method can modify changes sent in from the client and add additional properties. To do this you update properties in the newVersion and add additional property names to the changes property.
The Java class of the items supplied depends on the ActionScript class used by your client application. ActionScript to Java rules are by default used to convert the client object into a Java object. This will produce a java.util.Map for the item parameter if the client object is dynamic object or if that object does not have a RemoteClass alias mapping it to a Java class. If your assembler expects instances of a single specific Java class, you can use the item-class tag in your destination's configuration to specify a single class of which all java.util.Map instances are converted into before being passed to the assembler.
updateItem in interface AssemblerupdateItem in class AbstractAssemblernewVersion - the new version of the item with which to perform the updateprevVersion - the original version of the item before these changes were
made (used for conflict detection).changes - the list of changed property names.public boolean autoRefreshFill(List fillParams)
autoRefreshFill in interface AssemblerautoRefreshFill in class AbstractAssemblerfillParams - Client-side parameters to a fill method that
created a managed collection still managed by one or more clients.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/data/assemblers/SQLAssembler.html