try update pac ip address

This commit is contained in:
Peter Hormanns 2022-07-29 14:38:09 +02:00
parent 4c89c31575
commit 8069fea36b
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
@ -77,7 +78,7 @@ public class Pac extends AbstractEntity implements Serializable {
private boolean free = false;
@JoinColumn(name = "cur_inet_addr_id", nullable = true)
@ManyToOne(fetch = EAGER)
@ManyToOne(fetch = EAGER, cascade = CascadeType.MERGE)
@AnnFieldIO(rw=ReadWriteAccess.WRITEONCE,validation="[0-9\\.]*",overwriteName="curinetaddr")
private INetAddress curINetAddr;

View File

@ -81,7 +81,9 @@ public class PacRemote extends AbstractRemote {
pac.setCurINetAddr(curINetAddr);
}
if (curINetAddr != null && curINetAddr.getInet4Addr() != null && assertNotNull(inetAddrString) && !curINetAddr.getInet4Addr().equals(inetAddrString)) {
System.out.println("IP Update: " + inetAddrString);
curINetAddr = new INetAddress(inetAddrString);
pac.setCurINetAddr(curINetAddr);
}
Customer customer = pac.getCustomer();
String memberCode = (String) setParams.get("customer");