Home » Enterprise Java » Page 115

Enterprise Java

One To Many unidirectional mapping in JPA

This is an example of how to use One to Many unidirectional mapping in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications. Here, we are using the JPA to define a one to many unidirectional mapping between two entities.           Employee Class and Phone ...

Read More »

Many To One Mapping in JPA

In this example we shall show you how to create a many to one mapping in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications. Here, we are using the JPA to define a many to one mapping between two entities.             ManyToOneMappingInJPA class ...

Read More »

Delete with condition in JPA

With this example we are going to demonstrate how to delete with a condition in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications. Here, we are using JPA to delete an entity using a condition.               DeleteWithCondition class In DeleteWithCondition class we ...

Read More »

Remove Entity with JPA

This is an example of how to remove an entity using the JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                   Here, we are using JPA to remove an entity, as shown below: RemoveEntityWithJPA class In RemoveEntityWithJPA we create an ...

Read More »

Set column name and length

In this example we shall show you how to set the column name and length in an entity field in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                 Here, we are using JPA to set the column name and length ...

Read More »

Get single object in JPA

With this example we are going to demonstrate how to get a single object in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                   Here, we are using JPA to retrieve a single object from the database, as shown below: ...

Read More »

Find by class in JPA

This is an example of how to find an object by class in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                     Here, we are using JPA to retrieve an object by class, as shown below: The FindByClassInJPA class ...

Read More »

Find by id in JPA

In this example we shall show you how to find an object by id in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                     Here, we are using JPA to retrieve an object by id, as shown below: The ...

Read More »

Persist object with JPA

With this example we are going to demonstrate how to persist an object using the JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                     Here, we are using JPA to persist an object, as shown below: The PersistObjectWithJPA class ...

Read More »

JPA CRUD Example

This is an example of how to perform CRUD functionality in JPA. The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.                     Here, we are using JPA to perform create, delete, update and delete methods, as shown below: Employee Class The ...

Read More »