Home » Archives for Alin Constantin

Author Archives: Alin Constantin

Alin Constantin
Java Software Developer

JPA Named Query Example

1. Introduction In this article you will learn how to use the JPA @NamedQuery and @NamedNativeQuery annotations. We will start by introducing some general aspects about named queries, then creating simple examples, using both JPQL and native SQL queries, passing parameters to named queries and using vendor-specific query hints. You will then learn how to execute named queries and use ...

Read More »

JPA One-to-One Example

1. Introduction In this article we will explore the JPA @OneToOne association in a SQL and NoSQL fashion. A @OneToOne association occurs when there is exactly one record in a table that corresponds to exactly one record in a related table. In this case, both tables will contain the same number of records and each row of the first table ...

Read More »

JPA One-to-Many Example

1. Introduction In this article we will explore the JPA @OneToMany and @ManyToOne associations in a SQL and NoSQL fashion. A @OneToMany association occurs when each record in one table corresponds to multiple records in a related table. If the records from the second table have an inverse association back to the first table, we say that we have a ...

Read More »

Maven Skip Tests Example

1. Introduction In this example we will explore Maven capabilities to skip running/compiling unit tests during a project build. Although this is not a recommended option, sometimes we may want to speed up the overall build by skipping tests from running for a particular project, for some projects or for all our projects. To run the examples in this article ...

Read More »