From 7703bb2821ba8914db48882b303b14903f397bf4 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Mon, 28 Jul 2014 11:57:08 +0200
Subject: [PATCH] remove customer reference to bankaccount

---
 hsarback/src/de/hsadmin/mods/cust/Customer.java           |   18 +++---
 hsarback/src/de/hsadmin/remote/CustomerRemote.java        |   98 ++++++++++++++++----------------
 hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java |   12 ++--
 3 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/cust/Customer.java b/hsarback/src/de/hsadmin/mods/cust/Customer.java
index 3d87efe..add367f 100644
--- a/hsarback/src/de/hsadmin/mods/cust/Customer.java
+++ b/hsarback/src/de/hsadmin/mods/cust/Customer.java
@@ -93,8 +93,8 @@
 	@OneToMany(fetch = EAGER, cascade = ALL, mappedBy = "customer")
 	private Set<Contact> contacts;
 
-	@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
-	private BankAccount bankAccount;
+//	@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
+//	private BankAccount bankAccount;
 
 	@OneToMany(fetch = LAZY, cascade = ALL, mappedBy = "customer")
 	@OrderBy("name")
@@ -233,13 +233,13 @@
 		contacts.add(contact);
 	}
 
-	public BankAccount getBankAccount() {
-		return bankAccount;
-	}
-
-	public void setBankAccount(BankAccount bankAccount) {
-		this.bankAccount = bankAccount;
-	}
+//	public BankAccount getBankAccount() {
+//		return bankAccount;
+//	}
+//
+//	public void setBankAccount(BankAccount bankAccount) {
+//		this.bankAccount = bankAccount;
+//	}
 
 	public Set<Pac> getPacs() {
 		return pacs;
diff --git a/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java b/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
index 042983d..7ce9c41 100644
--- a/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
+++ b/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
@@ -36,12 +36,12 @@
 		if (contact.getFirstName() != null && contact.getFirstName().length() > 0) {
 			custComment = contact.getFirstName() + " " + contact.getLastName();
 		}
-		BankAccount bankAccount = newCustomer.getBankAccount();
-		if (bankAccount == null) {
-			bankAccount = new BankAccount();
-			bankAccount.setCustomer(newCustomer);
-			newCustomer.setBankAccount(bankAccount);
-		}
+//		BankAccount bankAccount = newCustomer.getBankAccount();
+//		if (bankAccount == null) {
+//			bankAccount = new BankAccount();
+//			bankAccount.setCustomer(newCustomer);
+//			newCustomer.setBankAccount(bankAccount);
+//		}
 		GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction());
 		
 		UnixUser custAccount = new UnixUser();
diff --git a/hsarback/src/de/hsadmin/remote/CustomerRemote.java b/hsarback/src/de/hsadmin/remote/CustomerRemote.java
index 1b8a20c..4b96975 100644
--- a/hsarback/src/de/hsadmin/remote/CustomerRemote.java
+++ b/hsarback/src/de/hsadmin/remote/CustomerRemote.java
@@ -47,17 +47,17 @@
 		}
 		resultMap.put("sharessigned", Integer.toString(cust.getSharesSigned()));
 		resultMap.put("uidvat", cust.getUidVAT());
-		BankAccount bank = cust.getBankAccount();
-		if (bank != null) {
-			resultMap.put("autodebit_ga", bank.getAutoDebitGA() != null && bank.getAutoDebitGA() ? "Yes" : "No");
-			resultMap.put("autodebit_ar", bank.getAutoDebitAR() != null && bank.getAutoDebitAR() ? "Yes" : "No");
-			resultMap.put("autodebit_op", bank.getAutoDebitOP() != null && bank.getAutoDebitOP() ? "Yes" : "No");
-			resultMap.put("bank_customer", bank.getBankCustomer());
-			resultMap.put("bank_iban", bank.getBankIBAN());
-			resultMap.put("bank_bic", bank.getBankBIC());
-			resultMap.put("bank_name", bank.getBankName());
-			resultMap.put("mandat_ref", bank.getMandatRef());
-		}
+//		BankAccount bank = cust.getBankAccount();
+//		if (bank != null) {
+//			resultMap.put("autodebit_ga", bank.getAutoDebitGA() != null && bank.getAutoDebitGA() ? "Yes" : "No");
+//			resultMap.put("autodebit_ar", bank.getAutoDebitAR() != null && bank.getAutoDebitAR() ? "Yes" : "No");
+//			resultMap.put("autodebit_op", bank.getAutoDebitOP() != null && bank.getAutoDebitOP() ? "Yes" : "No");
+//			resultMap.put("bank_customer", bank.getBankCustomer());
+//			resultMap.put("bank_iban", bank.getBankIBAN());
+//			resultMap.put("bank_bic", bank.getBankBIC());
+//			resultMap.put("bank_name", bank.getBankName());
+//			resultMap.put("mandat_ref", bank.getMandatRef());
+//		}
 		Set<Contact> contacts = cust.getContacts();
 		if (contacts != null && !contacts.isEmpty()) {
 			Contact c = contacts.iterator().next();
@@ -131,44 +131,44 @@
 		if (assertNotNull(uidVat)) {
 			cust.setUidVAT(uidVat);
 		}
-		BankAccount bank = cust.getBankAccount();
-		if (bank == null) {
-			bank = new BankAccount();
-			bank.setCustomer(cust);
-			cust.setBankAccount(bank);
-			bank.setMandatRef(memberNo);
-		}
-		String autoDebitGA = (String) setParams.get("autodebit_ga");
-		if (assertNotNull(autoDebitGA)) {
-			autoDebitGA = autoDebitGA.toUpperCase();
-			bank.setAutoDebitGA(new Boolean(autoDebitGA.startsWith("T") || autoDebitGA.startsWith("Y")));
-		}
-		String autoDebitAR = (String) setParams.get("autodebit_ar");
-		if (assertNotNull(autoDebitAR)) {
-			autoDebitAR = autoDebitAR.toUpperCase();
-			bank.setAutoDebitAR(new Boolean(autoDebitAR.startsWith("T") || autoDebitAR.startsWith("Y")));
-		}
-		String autoDebitOP = (String) setParams.get("autodebit_op");
-		if (assertNotNull(autoDebitOP)) {
-			autoDebitOP = autoDebitOP.toUpperCase();
-			bank.setAutoDebitOP(new Boolean(autoDebitOP.startsWith("T") || autoDebitOP.startsWith("Y")));
-		}
-		String bankCustomer = (String) setParams.get("bank_customer");
-		if (assertNotNull(bankCustomer)) {
-			bank.setBankCustomer(bankCustomer);
-		}
-		String bankIBAN = (String) setParams.get("bank_iban");
-		if (assertNotNull(bankIBAN)) {
-			bank.setBankIBAN(bankIBAN);
-		}
-		String bankBIC = (String) setParams.get("bank_bic");
-		if (assertNotNull(bankBIC)) {
-			bank.setBankBIC(bankBIC);
-		}
-		String bankName = (String) setParams.get("bank_name");
-		if (assertNotNull(bankName)) {
-			bank.setBankName(bankName);
-		}
+//		BankAccount bank = cust.getBankAccount();
+//		if (bank == null) {
+//			bank = new BankAccount();
+//			bank.setCustomer(cust);
+//			cust.setBankAccount(bank);
+//			bank.setMandatRef(memberNo);
+//		}
+//		String autoDebitGA = (String) setParams.get("autodebit_ga");
+//		if (assertNotNull(autoDebitGA)) {
+//			autoDebitGA = autoDebitGA.toUpperCase();
+//			bank.setAutoDebitGA(new Boolean(autoDebitGA.startsWith("T") || autoDebitGA.startsWith("Y")));
+//		}
+//		String autoDebitAR = (String) setParams.get("autodebit_ar");
+//		if (assertNotNull(autoDebitAR)) {
+//			autoDebitAR = autoDebitAR.toUpperCase();
+//			bank.setAutoDebitAR(new Boolean(autoDebitAR.startsWith("T") || autoDebitAR.startsWith("Y")));
+//		}
+//		String autoDebitOP = (String) setParams.get("autodebit_op");
+//		if (assertNotNull(autoDebitOP)) {
+//			autoDebitOP = autoDebitOP.toUpperCase();
+//			bank.setAutoDebitOP(new Boolean(autoDebitOP.startsWith("T") || autoDebitOP.startsWith("Y")));
+//		}
+//		String bankCustomer = (String) setParams.get("bank_customer");
+//		if (assertNotNull(bankCustomer)) {
+//			bank.setBankCustomer(bankCustomer);
+//		}
+//		String bankIBAN = (String) setParams.get("bank_iban");
+//		if (assertNotNull(bankIBAN)) {
+//			bank.setBankIBAN(bankIBAN);
+//		}
+//		String bankBIC = (String) setParams.get("bank_bic");
+//		if (assertNotNull(bankBIC)) {
+//			bank.setBankBIC(bankBIC);
+//		}
+//		String bankName = (String) setParams.get("bank_name");
+//		if (assertNotNull(bankName)) {
+//			bank.setBankName(bankName);
+//		}
 		Set<Contact> contacts = cust.getContacts();
 		Contact c = null;
 		if (contacts == null || contacts.isEmpty()) {

--
Gitblit v1.9.0-SNAPSHOT