MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Betriebsanweisung Seite 241

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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);
}
}
Seitenansicht 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare