Folgender Fall: Die Rechnungen der Kunden werden nicht in der Nuclos-Datenbank gespeichert, sondern werden auf einem Drittsystem gepflegt. Dazu kann ein sogenanntes "ProxyBO" Rechnungen im Bo-Wizard erstellt werden. Damit wird ein Interface (hier: "
org.nuclet.businessentity.RechnungProxy") zur Verfügung gestellt, dessen Implementationen die Daten holt, bzw. schreibt:
package org.nuclet.businessentity; import java.util.*; import org.nuclos.api.exception.*; import org.nuclos.api.rule.*; public class RechnungProxyImpl implements org.nuclet.businessentity.RechnungProxy { private User user; public List<Rechnung> getByKunde(Long id) { List<Rechnung> rlist = new ArrayList<>(); // Get Rechnungen for Kunde with "id" from another source // ... // rlist.add(...) // return rlist; } public List<Rechnung> getAll() { // Get Data from another source } public List<Long> getAllIds() { // Get Data from another source } public Rechnung getById(Long id) { // Get Data from another source } public void insert(Rechnung rechnung) throws BusinessException { // Write Data to another source } public void update(Rechnung rechnung) throws BusinessException { // Write Data to another source } public void delete(Long id) throws BusinessException { // Delete Data within another source } public void commit() { } public void rollback() { } public void setUser(User user) { this.user = user; } }
Überblick
Inhalte