Java Persistence API (JPA) Tutorials

Example blog post alt

JPA one to one mapping with annotation (Java persistence API)

n a bi-directional one to one mapping, both sides are responsibve for managing the relationship and hence both entities must have each other's instances setted to their instance using getters and setters, failing so will end up inserting a null in the db foreign key columns and one could not be able to get other object's details with one object.

Continue reading

Example blog post alt

JPA one to many mapping with annotation (Java persistence API)

In previous article we have seen, how to configure one to one mapping in JPA in both unidirectional and bidirectional way. In this article we will see how yo configure one to many mappings in JPA using annotations.

Continue reading

Example blog post alt

JPA many to many mapping with annotation (Java persistence API)

In previous articles we have seen one to one and one to many mappings in JPA. In this article we will see how to configure and use Many to Many mappings in JPA.

Continue reading

Example blog post alt

JPA Inheritance Strategies using annotations - Table per hierarchy

In our previous articles we have seen, one to one, many to one and many to many mappings, in this article we will see how to map a inheritance class structures with JPA. There are three major strategies for doing this. 1) Table per hierarchy 2) Table per concrete class 3) Table per subclass

Continue reading

Example blog post alt

JPA Inheritance Strategies using annotations - Table per concrete class

In our previous articles we have seen, one to one, many to one and many to many mappings, in this article we will see how to map a inheritance class structures with JPA. There are three major strategies for doing this. 1) Table per hierarchy 2) Table per concrete class 3) Table per subclass

Continue reading

Example blog post alt

JPA Inheritance Strategies using annotations - Table per sub class

In our previous articles we have seen, one to one, many to one and many to many mappings, in this article we will see how to map a inheritance class structures with JPA. There are three major strategies for doing this. 1) Table per hierarchy 2) Table per concrete class 3) Table per subclass

Continue reading

Got a technical query, or stuck somewhere ?