Business Logic Component Prototype

The following code is from the BusLogicDemo project.  You can copy/paste this into your project, and change the obvious elements (references to Customer, etc.):

package buslogicdemo.businesslogic;


import buslogicdemo.data.Customer;

import com.autobizlogic.abl.annotations.*;


public class CustomerLogic {

@CurrentBean

Customer customer;


@OldBean

Customer customer_old;


@Constraint( value = "balance <= creditLimit"errorMessage = "Customer {name} has a balance of ${balance} which exceeds the credit limit of ${creditLimit}")

public void constraintCreditLimit() {}


@Sum("purchaseorders.amountTotal where paid = false")

public void deriveBalance() { }

}


Comments