MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guia do Utilizador Página 241

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 256
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 240
Build a distributed application with the Java adapter 241
The following example shows the assembler classs doCreate(), doUpdate(), and
doDelete() methods:
private ChangeObject doCreate(ChangeObject co)
{
ContactDAO dao = new ContactDAO();
Contact contact = dao.create((Contact) co.getNewVersion());
co.setNewVersion(contact);
return co;
}
private void doUpdate(ChangeObject co)
{
ContactDAO dao = new ContactDAO();
try
{
dao.update((Contact) co.getNewVersion(), (Contact)
co.getPreviousVersion());
}
catch (ConcurrencyException e)
{
System.err.println("*** Throwing DataSyncException when trying to
update contact id=" + ((Contact) co.getNewVersion()).getContactId() );
throw new DataSyncException(co);
}
}
private void doDelete(ChangeObject co)
{
ContactDAO dao = new ContactDAO();
try
{
dao.delete((Contact) co.getPreviousVersion());
}
catch (ConcurrencyException e)
{
System.err.println("*** Throwing DataSyncException when trying to
delete contact id=" + ((Contact) co.getNewVersion()).getContactId() );
throw new DataSyncException(co);
}
}
Vista de página 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 255 256

Comentários a estes Manuais

Sem comentários