PacAdministrationVO in ContactVO

This commit is contained in:
Peter Hormanns 2017-04-13 19:29:47 +02:00
parent 8b5994e429
commit bb44a3233a
5 changed files with 101 additions and 1 deletions

View File

@ -105,6 +105,7 @@
<debug>false</debug> <debug>false</debug>
<debugPort>8000</debugPort> <debugPort>8000</debugPort>
<config>${project.basedir}/src/test/tomee/conf</config> <config>${project.basedir}/src/test/tomee/conf</config>
<context>cust-webapp</context>
<libs> <libs>
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib> <lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
</libs> </libs>

View File

@ -260,4 +260,12 @@ public class Contact implements Serializable {
this.roles = roles; this.roles = roles;
} }
public List<PacAdministration> getPacAdminList() {
return pacAdminList;
}
public void setPacAdminList(List<PacAdministration> pacAdminList) {
this.pacAdminList = pacAdminList;
}
} }

View File

@ -26,7 +26,7 @@ public class PacAdministration {
private Contact contact; private Contact contact;
@ManyToOne(fetch=FetchType.EAGER) @ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="packet_id") @JoinColumn(name="pac_id")
private Pac pac; private Pac pac;
public PacAdministration() { public PacAdministration() {

View File

@ -1,11 +1,14 @@
package de.hsadmin.service.customer; package de.hsadmin.service.customer;
import java.util.List;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import de.hsadmin.common.error.TechnicalException; import de.hsadmin.common.error.TechnicalException;
import de.hsadmin.module.ValueObject; import de.hsadmin.module.ValueObject;
import de.hsadmin.module.impl.AbstractVO; import de.hsadmin.module.impl.AbstractVO;
import de.hsadmin.module.property.ElementsType;
import de.hsadmin.module.property.ReadWrite; import de.hsadmin.module.property.ReadWrite;
import de.hsadmin.module.property.ReadWritePolicy; import de.hsadmin.module.property.ReadWritePolicy;
import de.hsadmin.module.property.Required; import de.hsadmin.module.property.Required;
@ -26,6 +29,11 @@ public class ContactVO extends AbstractVO implements ValueObject {
@Search(SearchPolicy.EQUALS) @Search(SearchPolicy.EQUALS)
private String customer; private String customer;
@Pattern(regexp="[a-z0-9\\-]*")
@Size(min=0,max=40)
@ReadWrite(ReadWritePolicy.READWRITE)
private String login;
@Pattern(regexp="[A-Za-z]*") @Pattern(regexp="[A-Za-z]*")
@Size(min=0,max=16) @Size(min=0,max=16)
@ReadWrite(ReadWritePolicy.READWRITE) @ReadWrite(ReadWritePolicy.READWRITE)
@ -103,6 +111,10 @@ public class ContactVO extends AbstractVO implements ValueObject {
@ReadWrite(ReadWritePolicy.READWRITE) @ReadWrite(ReadWritePolicy.READWRITE)
private final StringSet roles; private final StringSet roles;
@ReadWrite(ReadWritePolicy.READWRITE)
@ElementsType(PacAdministrationVO.class)
private List<PacAdministrationVO> pacAdminList;
public ContactVO() throws TechnicalException { public ContactVO() throws TechnicalException {
super(); super();
@ -117,6 +129,14 @@ public class ContactVO extends AbstractVO implements ValueObject {
this.customer = customer; this.customer = customer;
} }
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getSalut() { public String getSalut() {
return salut; return salut;
} }
@ -245,4 +265,12 @@ public class ContactVO extends AbstractVO implements ValueObject {
roles.setStrings(changedRoles); roles.setStrings(changedRoles);
} }
public List<PacAdministrationVO> getPacAdminList() {
return pacAdminList;
}
public void setPacAdminList(List<PacAdministrationVO> pacAdminList) {
this.pacAdminList = pacAdminList;
}
} }

View File

@ -0,0 +1,63 @@
package de.hsadmin.service.customer;
import de.hsadmin.common.error.TechnicalException;
import de.hsadmin.module.ValueObject;
import de.hsadmin.module.impl.AbstractVO;
import de.hsadmin.module.property.ReadWrite;
import de.hsadmin.module.property.ReadWritePolicy;
import de.hsadmin.module.property.mapping.DefaultStringParameterMapMapper;
import de.hsadmin.module.property.mapping.Mapping;
import de.hsadmin.module.property.mapping.ReferredStringPersistentObjectMapper;
public class PacAdministrationVO extends AbstractVO implements ValueObject {
@Mapping(
boMapping=ReferredStringPersistentObjectMapper.class,
rpcMapping=DefaultStringParameterMapMapper.class,
boMappingPath="contact.customer.name")
@ReadWrite(ReadWritePolicy.READ)
private String customer;
@Mapping(
boMapping=ReferredStringPersistentObjectMapper.class,
rpcMapping=DefaultStringParameterMapMapper.class,
boMappingPath="contact.login")
@ReadWrite(ReadWritePolicy.READ)
private String contactLogin;
@Mapping(
boMapping=ReferredStringPersistentObjectMapper.class,
rpcMapping=DefaultStringParameterMapMapper.class,
boMappingPath="pac.name")
@ReadWrite(ReadWritePolicy.READ)
private String packetName;
public PacAdministrationVO() throws TechnicalException {
super();
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public String getContactLogin() {
return contactLogin;
}
public void setContactLogin(String contactLogin) {
this.contactLogin = contactLogin;
}
public String getPacketName() {
return packetName;
}
public void setPacketName(String packetName) {
this.packetName = packetName;
}
}