Пример #1
0
 @Programmatic
 public BankAccount newBankAccount(
     final @ParameterLayout(named = "Owner") Party owner,
     final @ParameterLayout(named = "Reference") @Parameter(
             regexPattern = RegexValidation.REFERENCE) String reference,
     final @ParameterLayout(named = "Name") String name) {
   final BankAccount bankAccount = newTransientInstance(BankAccount.class);
   bankAccount.setReference(reference);
   bankAccount.setName(name);
   persistIfNotAlready(bankAccount);
   bankAccount.setOwner(owner);
   return bankAccount;
 }
Пример #2
0
 @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
 @ActionLayout(contributed = Contributed.AS_NEITHER)
 public BankAccount newBankAccount(
     final @ParameterLayout(named = "Owner") Party owner,
     final @ParameterLayout(named = "IBAN", typicalLength = JdoColumnLength.BankAccount.IBAN)
         String iban) {
   final BankAccount bankAccount = newTransientInstance(BankAccount.class);
   bankAccount.setReference(iban);
   bankAccount.setName(iban);
   bankAccount.setIban(iban);
   bankAccount.refresh();
   persistIfNotAlready(bankAccount);
   bankAccount.setOwner(owner);
   return bankAccount;
 }