Riferimenti per la classe org.jaebi.server.service.XRequestCommandUpdate

Diagramma delle classi per org.jaebi.server.service.XRequestCommandUpdate

Inheritance graph
[legenda]
Diagramma di collaborazione per org.jaebi.server.service.XRequestCommandUpdate:

Collaboration graph
[legenda]
Lista di tutti i membri.

Descrizione Dettagliata

Autore:
detro
Questa classe mappa uno Comando-Statement SQL di tipo UPDATE.

Definizione alla linea 23 del file XRequestCommandUpdate.java.

Membri pubblici

 XRequestCommandUpdate (Xrequest xrequestObj, BackEndHandlerImpl backEndHandler) throws XRequestCommandInitException
 Creates a new instance of XRequestCommandSelect.
Object execute () throws CommandExecException
 Restituisce il risultato della UPDATE.
String getType ()
 Ritorna il valore dell'attributo "<code>/xrequest/@type</code>".
String getAffectedTable ()
 Table si cui viene eseguita l'XRequestCommand.
ArrayList getColumnsName ()
 Recupero valori di "<code>//Columns/Column/Name</code>".
HashMap getColumnsValue ()
 Recupero valori di "<code>//Columns/Column/Value</code>".
ArrayList getWhereColumnsName ()
 Recupero valori di "<code>//Where/Column/Name</code>".
HashMap getWhereColumnsValue ()
 Recupero valori di "<code>//Where/Column/Value</code>".
String toString ()
 Descrizione del Command.
boolean isExecuted ()
 Verifica se una Command e' stata gia' eseguita.

Attributi protetti

final BackEndHandlerImpl backEndHandler
 BackEndHandler su cui viene eseguito Command.
final Xrequest xrequestObj
 Oggetto Xrequest da Wrappare, che descrive il Command che lo User ha richiesto di eseguire.
boolean executed = false
 Variabile booleana per verificare se un Command e' stato eseguito o meno.

Attributi protetti statici

static final JAXBXResponseFactory xresponseFactory
 JAXBXResponseFactory utile a tutti gli XRequestCommand per produrre oggetti XResponse.
static String exceptionPrefix = "[XRequestCommand Exception]: "


Documentazione dei costruttori e dei distruttori

org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate Xrequest  xrequestObj,
BackEndHandlerImpl  backEndHandler
throws XRequestCommandInitException
 

Creates a new instance of XRequestCommandSelect.

Definizione alla linea 26 del file XRequestCommandUpdate.java.

Riferimenti org.jaebi.server.service.XRequestCommand.backEndHandler, org.jaebi.server.service.XRequestCommand.exceptionPrefix, e org.jaebi.server.service.XRequestCommand.xrequestObj.

00027                                             {
00028         
00029         super(xrequestObj, backEndHandler);
00030         
00031         /* Controlla se la Factory ha costruito 
00032          * l'XRequestCommand con l'Xrequest corretto */
00033         if ( !xrequestObj.getType().equalsIgnoreCase("update") ) {
00034             throw new XRequestCommandInitException(
00035                     exceptionPrefix + "Xrequest Type does not match");
00036         }
00037     }


Documentazione delle funzioni membro

Object org.jaebi.server.service.XRequestCommandUpdate.execute  )  throws CommandExecException [virtual]
 

Restituisce il risultato della UPDATE.

Restituisce:
Xresponse della Select

Implementa org.jaebi.server.service.XRequestCommand.

Definizione alla linea 44 del file XRequestCommandUpdate.java.

Riferimenti org.jaebi.server.service.XRequestCommand.backEndHandler, org.jaebi.server.service.xml.JAXBXResponseFactory.buildXresponse(), org.jaebi.server.service.XRequestCommand.exceptionPrefix, org.jaebi.server.service.XRequestCommand.getAffectedTable(), org.jaebi.server.service.XRequestCommand.getColumnsValue(), org.jaebi.server.service.XRequestCommand.getWhereColumnsName(), org.jaebi.server.service.XRequestCommand.getWhereColumnsValue(), org.jaebi.server.service.BackEndHandlerImpl.update(), e org.jaebi.server.service.XRequestCommand.xresponseFactory.

00045                                     {
00046         
00047         int affectedRows;
00048         
00049         try {
00050             if ( getWhereColumnsName().size() == 0 ) {
00051                 affectedRows = backEndHandler.update(
00052                     getAffectedTable(),
00053                     getColumnsValue()
00054                 );
00055             } else {
00056                 affectedRows = backEndHandler.update(
00057                     getAffectedTable(),
00058                     getColumnsValue(),
00059                     getWhereColumnsValue()
00060                 );
00061             }
00062             
00063             return xresponseFactory.buildXresponse(true, 
00064                     "UPDATE #" + affectedRows + " ROWS" );
00065             
00066         } catch ( JAXBXResponseFactoryBuildingException e ) {
00067             // Errore durante la creazione dell'XResponse
00068             try {
00069                 return xresponseFactory.buildXresponse(false, 
00070                         "Internal Error - " + e.getMessage() );
00071             } catch ( JAXBXResponseFactoryBuildingException otherE ) {
00072                 throw new CommandExecException( exceptionPrefix + otherE );
00073             }
00074         } catch ( BackEndHandlerGenericException e) {
00075             // Errore nel BackEnd
00076             try {
00077                 return xresponseFactory.buildXresponse(false, 
00078                         "BackEnd Error - " + e.getMessage() );
00079             } catch ( JAXBXResponseFactoryBuildingException otherE ) {
00080                 throw new CommandExecException( exceptionPrefix + otherE );
00081             }
00082         } catch ( BackEndHandlerSQLCreationException sqle) {
00083             // Errore nel BackEndHandler durante la creazione dell'SQL
00084             try {
00085                 return xresponseFactory.buildXresponse(false, 
00086                         "Error in Submitted Data - " + sqle.getMessage() );
00087             } catch ( JAXBXResponseFactoryBuildingException otherE ) {
00088                 throw new CommandExecException( exceptionPrefix + otherE );
00089             }
00090         }
00091     }

Questo è il grafo delle chiamate per questa funzione:

String org.jaebi.server.service.XRequestCommand.getAffectedTable  )  [inherited]
 

Table si cui viene eseguita l'XRequestCommand.

Restituisce:
Nome Tabella coinvolta dal Command

Definizione alla linea 116 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00116                                      {
00117         return xrequestObj.getTable();
00118     }

ArrayList org.jaebi.server.service.XRequestCommand.getColumnsName  )  [inherited]
 

Recupero valori di "<code>//Columns/Column/Name</code>".

Restituisce:
ArrayList dei valori contenuti nei nodi "Name", contenuti in "Column"

Definizione alla linea 176 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.columnsName, org.jaebi.server.service.XRequestCommand.getNameFromColumnList(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandSelect.execute().

00176                                       {
00177         if ( columnsName == null ) {
00178             if ( xrequestObj.getColumns() != null ) {
00179                 columnsName = getNameFromColumnList( 
00180                         xrequestObj.getColumns().getColumn() ); // Caching...
00181             } else
00182                 columnsName = new ArrayList();
00183         }
00184         return columnsName; // Using Cache...
00185     }

Questo è il grafo delle chiamate per questa funzione:

HashMap org.jaebi.server.service.XRequestCommand.getColumnsValue  )  [inherited]
 

Recupero valori di "<code>//Columns/Column/Value</code>".

Indicizzati in base ai rispettivi "<code>//Columns/Column/Value/../Name</code>"

Restituisce:
HashMap dei valori contenuti nei nodi "Value", contenuti in "Column"

Definizione alla linea 196 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.columnsValue, org.jaebi.server.service.XRequestCommand.getValueFromColumnList(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), e org.jaebi.server.service.XRequestCommandInsert.execute().

00196                                      {
00197         if ( columnsValue == null ) {
00198             if ( xrequestObj.getColumns() != null ) {
00199                 columnsValue = getValueFromColumnList( 
00200                         xrequestObj.getColumns().getColumn() ); // Caching...
00201             } else
00202                 columnsValue = new HashMap();
00203         }
00204         return columnsValue; // Using Cache...
00205     }

Questo è il grafo delle chiamate per questa funzione:

String org.jaebi.server.service.XRequestCommand.getType  )  [virtual, inherited]
 

Ritorna il valore dell'attributo "<code>/xrequest/@type</code>".

Implementa org.jaebi.server.service.Command.

Definizione alla linea 107 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.xrequestObj.

00107                             {
00108         return xrequestObj.getType();
00109     }

ArrayList org.jaebi.server.service.XRequestCommand.getWhereColumnsName  )  [inherited]
 

Recupero valori di "<code>//Where/Column/Name</code>".

Restituisce:
ArrayList dei valori contenuti nei nodi "Name", contenuti in "Column"

Definizione alla linea 212 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.getNameFromColumnList(), org.jaebi.server.service.XRequestCommand.whereColumnsName, e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00212                                            {
00213         if ( whereColumnsName == null ) {
00214             if ( xrequestObj.getWhere() != null ) {
00215                 whereColumnsName = getNameFromColumnList( 
00216                         xrequestObj.getWhere().getColumn() ); // Caching...
00217             } else
00218                 whereColumnsName = new ArrayList();
00219         }
00220         return whereColumnsName; // Using Cache...
00221     }

Questo è il grafo delle chiamate per questa funzione:

HashMap org.jaebi.server.service.XRequestCommand.getWhereColumnsValue  )  [inherited]
 

Recupero valori di "<code>//Where/Column/Value</code>".

Indicizzati in base ai rispettivi "<code>//Where/Column/Value/../Name</code>"

Restituisce:
HashMap dei valori contenuti nei nodi "Value", contenuti in "Column"

Definizione alla linea 231 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.getValueFromColumnList(), org.jaebi.server.service.XRequestCommand.whereColumnsValue, e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00231                                           {
00232         if ( whereColumnsValue == null ) {
00233             if ( xrequestObj.getWhere() != null ) {
00234                 whereColumnsValue = getValueFromColumnList( 
00235                         xrequestObj.getWhere().getColumn() ); // Caching...
00236             } else
00237                 whereColumnsValue = new HashMap();
00238         }
00239         return whereColumnsValue; // Using Cache...
00240     }

Questo è il grafo delle chiamate per questa funzione:

boolean org.jaebi.server.service.Command.isExecuted  )  [inherited]
 

Verifica se una Command e' stata gia' eseguita.

Restituisce:
"true" in caso affermativo

Definizione alla linea 32 del file Command.java.

Riferimenti org.jaebi.server.service.Command.executed.

00032 { return executed; }

String org.jaebi.server.service.XRequestCommand.toString  )  [virtual, inherited]
 

Descrizione del Command.

Restituisce:
Una Stringa che descrive il Command

Implementa org.jaebi.server.service.Command.

Definizione alla linea 242 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapper.marshall(), org.jaebi.server.service.xml.JAXBMarshallerWrapper.setFormattedMarshalling(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

00242                              {
00243         JAXBMarshallerWrapper marshWrap = null;
00244         String result = null;
00245         
00246         try {
00247             marshWrap = new JAXBMarshallerWrapperImpl("org.jaebi.server.service.xml.xrequest");
00248             marshWrap.setFormattedMarshalling(true);
00249             result = marshWrap.marshall( xrequestObj );
00250         } catch ( JAXBMarshallerWrapperMarshallException e ) {
00251             return "<XRequestCommand> toString conversion (marshalling) exception:\n" + e;
00252         } catch ( JAXBMarshallerWrapperInitException e ) {
00253             return "<XRequestCommand> toString conversion (Marshall Wrapper Init) exception:\n" + e;
00254         }
00255         
00256         return result;
00257     }

Questo è il grafo delle chiamate per questa funzione:


Documentazione dei dati membri

final BackEndHandlerImpl org.jaebi.server.service.XRequestCommand.backEndHandler [protected, inherited]
 

BackEndHandler su cui viene eseguito Command.

Definizione alla linea 58 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), org.jaebi.server.service.XRequestCommandDelete.execute(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

String org.jaebi.server.service.XRequestCommand.exceptionPrefix = "[XRequestCommand Exception]: " [static, protected, inherited]
 

Definizione alla linea 82 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), org.jaebi.server.service.XRequestCommandDelete.execute(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

boolean org.jaebi.server.service.Command.executed = false [protected, inherited]
 

Variabile booleana per verificare se un Command e' stato eseguito o meno.

Definizione alla linea 25 del file Command.java.

Referenziato da org.jaebi.server.service.Command.isExecuted().

final Xrequest org.jaebi.server.service.XRequestCommand.xrequestObj [protected, inherited]
 

Oggetto Xrequest da Wrappare, che descrive il Command che lo User ha richiesto di eseguire.

Definizione alla linea 62 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getAffectedTable(), org.jaebi.server.service.XRequestCommand.getColumnsName(), org.jaebi.server.service.XRequestCommand.getColumnsValue(), org.jaebi.server.service.XRequestCommand.getType(), org.jaebi.server.service.XRequestCommand.getWhereColumnsName(), org.jaebi.server.service.XRequestCommand.getWhereColumnsValue(), org.jaebi.server.service.XRequestCommand.toString(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

final JAXBXResponseFactory org.jaebi.server.service.XRequestCommand.xresponseFactory [static, protected, inherited]
 

Valore iniziale:

 
            new JAXBXResponseFactory()
JAXBXResponseFactory utile a tutti gli XRequestCommand per produrre oggetti XResponse.

Definizione alla linea 54 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().


La documentazione per questa classe è stata generata a partire dal seguente file:
Generato il Mon Jun 27 22:50:53 2005 per JAEBI - JAva Enterprice BackEnd Interfacement da  doxygen 1.4.3