Memorynotfound Java Programming Tutorials
Hibernate/JPA Single Table Inheritance Example
In this tutorial, we show how to map entity hierarchies onto database tables. There are several ways of mapping inheritance to the database. Here, we’ll look into Hibernate/JPA single table inheritance. The single table...
Converting a String into a LocalDate – Java 8
This tutorial shows how to convert a java.lang.String into a java.time.LocalDate. We can convert a String into a Date using the parse() method of the LocalDate and DateTimeFormatter classes. // from java.lang.String into java.time.LocalDate...
Converting a String into a Date in Java
This tutorial shows how to convert a java.lang.String into a java.util.Date. We can convert a String into a Date using the parse() method of the DateFormat and SimpleDateFormat classes. // from java.lang.String into java.util.Date...
Getting Current Date and Time in Java
This tutorial shows how to get the current date and time in Java. The standard Java classes we can use are java.util.Date, java.util.Calendar and the new java 8 java.time.LocalDateTime and java.time.ZonedDateTime. You could also...
JPA EntityManager Example
This tutorial shows how to work with the Java Persistence API. The purpose of JPA is to create an abstraction layer between the database layer and an ORM framework. This enables us to loosely...
Hibernate Dynamic-Update Attriburte Example
This tutorial shows how to use the dynamic-update attribute or @DynamicUpdate annotation used by Hibernate. This attribute/annotation tells Hibernate to only include the updated properties of the entity in the SQL UPDATE Statement. Dynamic-update=false...
Hibernate dynamic-insert attriburte example
This tutorial shows how to use the dynamic-insert attribute or @DynamicInsert annotation used by Hibernate. This attribute/annotation tells Hibernate whether to include null properties in the SQL INSERT statement. Dynamic-insert=false By default, dynamic-insert is...
Hibernate @Embeddable and @Embedded Annotation Example
In this tutorial we show how to embed one entity inside another entity, so they are mapped to a single table. With Hibernate we can use the @Embeddable annotation to mark a class to...
Mapping Enum Types with Hibernate Example
In this tutorial we show how to persist Java Enum types using Hibernate. Hibernate supports the mapping of Java enums as basic value types in various ways. The @Enumerated annotation is the original JPA-compliant...