|
Inhaltsverzeichnis
Zuletzt aktualisiert
|
Code with Tooling Support:package de.jawiki; import java.util.HashSet; public class Customer { private long id; private String name; private Collection<Order> orders = new HashSet<Order>(); private Set<PhoneNumber> phones = new HashSet<PhoneNumber>(); @Id public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @OneToMany public Collection<Order> getOrders() { return orders; } public void setOrders(Collection<Order> orders) { this.orders = orders; } @ManyToMany public Set<PhoneNumber> getPhones() { return phones; } public void setPhones(Set<PhoneNumber> phones) { this.phones = phones; } public Customer() { // TODO Auto-generated constructor stub } } All informations are marked explizt. Compact Code (DSLized):entity Customer {
String name
Address address
Order[] orders
PhoneNumber[] phones
}
Code is using a lot of implizt informations like conventions:
But: It's difficult for tools to resolve those kind of implizit conventions, but they will hopefully do in the future. |
Kommentar hinzufügen