Here I am writing to cover up the difference between OrphanRemoval=true and CascadeType.REMOVE in JPA2.0 with hibernate.

Let say there is one to many relationship between User and Address and that can be defined in JPA as below:

public class User{ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user") public Set getAddresses() { return this.addresses; } } public class Address{ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name="userid") public User getUser() { return this.user; } } You can have more detail in this post about above entities.

Having installed Graylog2 for centralized logging, we quickly wanted to test it's syslog capability. Configuring syslog daemon to redirect its log on remote server is easy to setup, but  requires administrator privileges.

To quickly verify whether syslog daemon inside Graylog2 is working or not there is an easy way out.

Criteria Query has been introduced in JPA 2.0. With the help of criteria queries you can write your queries in a type-safe way. Before criteria queries, developers had to write queries through the construction of object-based query definitions. There might be chances of incorrect syntax while building the queries. The criteria query API provides feature to create structured and nested queries with compile time safety.
1
Loading