December 2019
Intermediate to advanced
314 pages
6h 51m
English
The first thing we need to check is the list of entity objects that will map the database tables. The first one is the Customer @Entity class, as follows:
@Entity@NamedQuery(name = "Customers.findAll", query = "SELECT c FROM Customer c ORDER BY c.id", hints = @QueryHint(name = "org.hibernate.cacheable", value = "true") )public class Customer { @Id @SequenceGenerator( name = "customerSequence", sequenceName = "customerId_seq", allocationSize = 1, initialValue = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "customerSequence") private Long id; @Column(length = 40) private String name; @Column(length = 40) private String surname; @OneToMany(mappedBy = "customer") @JsonbTransient public List<Orders> ...
Read now
Unlock full access