diff --git a/persistence-modules/hibernate-annotations/README.md b/persistence-modules/hibernate-annotations/README.md index 2813dbdda3..393cf82bfd 100644 --- a/persistence-modules/hibernate-annotations/README.md +++ b/persistence-modules/hibernate-annotations/README.md @@ -1,10 +1,10 @@ ## Hibernate Annotations -This module contains articles about Hibernate Annotations. +This module contains articles about Annotations used in Hibernate. ### Relevant Articles: - [Custom Types in Hibernate and the @Type Annotation](https://www.baeldung.com/hibernate-custom-types) - [@JoinColumn Annotation Explained](https://www.baeldung.com/jpa-join-column) - [Difference Between @JoinColumn and mappedBy](https://www.baeldung.com/jpa-joincolumn-vs-mappedby) -- [Hibernate One to Many Annotation Tutorial](http://www.baeldung.com/hibernate-one-to-many) +- [Hibernate One to Many Annotation Tutorial](https://www.baeldung.com/hibernate-one-to-many) - [Hibernate @WhereJoinTable Annotation](https://www.baeldung.com/hibernate-wherejointable) diff --git a/persistence-modules/hibernate-enterprise/README.md b/persistence-modules/hibernate-enterprise/README.md index c48092e6a2..c5606d0970 100644 --- a/persistence-modules/hibernate-enterprise/README.md +++ b/persistence-modules/hibernate-enterprise/README.md @@ -1,11 +1,11 @@ ## Hibernate Enterprise -This module contains articles about Hibernate. +This module contains articles about enterprise concerns such as Multitenancy, Errors, Exceptions, Logging and more in Hibernate. ### Relevant articles: -- [Introduction to Hibernate Spatial](http://www.baeldung.com/hibernate-spatial) -- [A Guide to Multitenancy in Hibernate 5](http://www.baeldung.com/hibernate-5-multitenancy) +- [Introduction to Hibernate Spatial](https://www.baeldung.com/hibernate-spatial) +- [A Guide to Multitenancy in Hibernate 5](https://www.baeldung.com/hibernate-5-multitenancy) - [Hibernate Aggregate Functions](https://www.baeldung.com/hibernate-aggregate-functions) - [Common Hibernate Exceptions](https://www.baeldung.com/hibernate-exceptions) - [Hibernate Error “Not all named parameters have been set”](https://www.baeldung.com/hibernate-error-named-parameters-not-set) diff --git a/persistence-modules/hibernate-jpa/README.md b/persistence-modules/hibernate-jpa/README.md index fb1d46cf9b..d0a253f028 100644 --- a/persistence-modules/hibernate-jpa/README.md +++ b/persistence-modules/hibernate-jpa/README.md @@ -1,13 +1,13 @@ ## Hibernate JPA -This module contains articles about Hibernate JPA. +This module contains articles specific to use of Hibernate as a JPA implementation, such as Locking, Bootstrapping, One-to-One Relationship, Persistence Context, and more. ### Relevant articles: -- [JPA Attribute Converters](http://www.baeldung.com/jpa-attribute-converters) -- [Pessimistic Locking in JPA](http://www.baeldung.com/jpa-pessimistic-locking) +- [JPA Attribute Converters](https://www.baeldung.com/jpa-attribute-converters) +- [Pessimistic Locking in JPA](https://www.baeldung.com/jpa-pessimistic-locking) - [Bootstrapping JPA Programmatically in Java](http://www.baeldung.com/java-bootstrap-jpa) -- [Optimistic Locking in JPA](http://www.baeldung.com/jpa-optimistic-locking) +- [Optimistic Locking in JPA](https://www.baeldung.com/jpa-optimistic-locking) - [Criteria API – An Example of IN Expressions](https://www.baeldung.com/jpa-criteria-api-in-expressions) - [One-to-One Relationship in JPA](https://www.baeldung.com/jpa-one-to-one) - [Enabling Transaction Locks in Spring Data JPA](https://www.baeldung.com/java-jpa-transaction-locks) diff --git a/persistence-modules/hibernate-mapping/README.md b/persistence-modules/hibernate-mapping/README.md index 5ba73f35f3..b5d0cb2f99 100644 --- a/persistence-modules/hibernate-mapping/README.md +++ b/persistence-modules/hibernate-mapping/README.md @@ -7,9 +7,9 @@ This module contains articles about Object-relational Mapping (ORM) with Hiberna - [Persisting Maps with Hibernate](https://www.baeldung.com/hibernate-persisting-maps) - [Difference Between @Size, @Length, and @Column(length=value)](https://www.baeldung.com/jpa-size-length-column-differences) - [Hibernate Validator Specific Constraints](https://www.baeldung.com/hibernate-validator-constraints) -- [Dynamic Mapping with Hibernate](http://www.baeldung.com/hibernate-dynamic-mapping) -- [Hibernate Inheritance Mapping](http://www.baeldung.com/hibernate-inheritance) +- [Dynamic Mapping with Hibernate](https://www.baeldung.com/hibernate-dynamic-mapping) +- [Hibernate Inheritance Mapping](https://www.baeldung.com/hibernate-inheritance) - [Mapping A Hibernate Query to a Custom Class](https://www.baeldung.com/hibernate-query-to-custom-class) -- [Hibernate – Mapping Date and Time](http://www.baeldung.com/hibernate-date-time) -- [Mapping LOB Data in Hibernate](http://www.baeldung.com/hibernate-lob) +- [Hibernate – Mapping Date and Time](https://www.baeldung.com/hibernate-date-time) +- [Mapping LOB Data in Hibernate](https://www.baeldung.com/hibernate-lob) - [FetchMode in Hibernate](https://www.baeldung.com/hibernate-fetchmode) diff --git a/persistence-modules/hibernate5-mapping/README.md b/persistence-modules/hibernate5-mapping/README.md deleted file mode 100644 index f18b0b63de..0000000000 --- a/persistence-modules/hibernate5-mapping/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## Hibernate 5 - -This module contains articles about Hibernate 5. - -### Relevant articles: - -- [Dynamic Mapping with Hibernate](http://www.baeldung.com/hibernate-dynamic-mapping) -- [Hibernate Inheritance Mapping](http://www.baeldung.com/hibernate-inheritance) -- [Mapping A Hibernate Query to a Custom Class](https://www.baeldung.com/hibernate-query-to-custom-class) -- [Hibernate – Mapping Date and Time](http://www.baeldung.com/hibernate-date-time) -- [Mapping LOB Data in Hibernate](http://www.baeldung.com/hibernate-lob) \ No newline at end of file diff --git a/persistence-modules/hibernate5-mapping/pom.xml b/persistence-modules/hibernate5-mapping/pom.xml deleted file mode 100644 index 59e0547671..0000000000 --- a/persistence-modules/hibernate5-mapping/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - hibernate5-mapping - 0.0.1-SNAPSHOT - hibernate5-mapping - - - com.baeldung - persistence-modules - 1.0.0-SNAPSHOT - - - - - org.hibernate - hibernate-core - ${hibernate.version} - - - org.assertj - assertj-core - ${assertj-core.version} - test - - - com.h2database - h2 - ${h2.version} - - - org.hibernate - hibernate-spatial - ${hibernate.version} - - - org.opengeo - geodb - ${geodb.version} - - - mysql - mysql-connector-java - ${mysql.version} - - - ch.vorburger.mariaDB4j - mariaDB4j - ${mariaDB4j.version} - - - org.hibernate - hibernate-testing - ${hibernate.version} - - - - - - geodb-repo - GeoDB repository - http://repo.boundlessgeo.com/main/ - - - - - 5.3.7.Final - 6.0.6 - 2.2.3 - 3.8.0 - 0.9 - - - diff --git a/persistence-modules/hibernate5-mapping/src/main/java/com/baeldung/hibernate/HibernateUtil.java b/persistence-modules/hibernate5-mapping/src/main/java/com/baeldung/hibernate/HibernateUtil.java deleted file mode 100644 index 28e1af49ed..0000000000 --- a/persistence-modules/hibernate5-mapping/src/main/java/com/baeldung/hibernate/HibernateUtil.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.baeldung.hibernate; - -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.util.Properties; - -import org.apache.commons.lang3.StringUtils; -import org.hibernate.SessionFactory; -import org.hibernate.boot.Metadata; -import org.hibernate.boot.MetadataSources; -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.service.ServiceRegistry; - -import com.baeldung.hibernate.entities.DeptEmployee; -import com.baeldung.hibernate.pojo.Employee; -import com.baeldung.hibernate.pojo.EntityDescription; -import com.baeldung.hibernate.pojo.Phone; -import com.baeldung.hibernate.pojo.TemporalValues; -import com.baeldung.hibernate.pojo.inheritance.Animal; -import com.baeldung.hibernate.pojo.inheritance.Bag; -import com.baeldung.hibernate.pojo.inheritance.Book; -import com.baeldung.hibernate.pojo.inheritance.Car; -import com.baeldung.hibernate.pojo.inheritance.MyEmployee; -import com.baeldung.hibernate.pojo.inheritance.MyProduct; -import com.baeldung.hibernate.pojo.inheritance.Pen; -import com.baeldung.hibernate.pojo.inheritance.Pet; -import com.baeldung.hibernate.pojo.inheritance.Vehicle; - -public class HibernateUtil { - private static String PROPERTY_FILE_NAME; - - public static SessionFactory getSessionFactory() throws IOException { - return getSessionFactory(null); - } - - public static SessionFactory getSessionFactory(String propertyFileName) throws IOException { - PROPERTY_FILE_NAME = propertyFileName; - ServiceRegistry serviceRegistry = configureServiceRegistry(); - return makeSessionFactory(serviceRegistry); - } - - public static SessionFactory getSessionFactoryByProperties(Properties properties) throws IOException { - ServiceRegistry serviceRegistry = configureServiceRegistry(properties); - return makeSessionFactory(serviceRegistry); - } - - private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry) { - MetadataSources metadataSources = new MetadataSources(serviceRegistry); - - metadataSources.addPackage("com.baeldung.hibernate.pojo"); - metadataSources.addAnnotatedClass(Employee.class); - metadataSources.addAnnotatedClass(Phone.class); - metadataSources.addAnnotatedClass(EntityDescription.class); - metadataSources.addAnnotatedClass(TemporalValues.class); - metadataSources.addAnnotatedClass(DeptEmployee.class); - metadataSources.addAnnotatedClass(com.baeldung.hibernate.entities.Department.class); - metadataSources.addAnnotatedClass(Animal.class); - metadataSources.addAnnotatedClass(Bag.class); - metadataSources.addAnnotatedClass(Book.class); - metadataSources.addAnnotatedClass(Car.class); - metadataSources.addAnnotatedClass(MyEmployee.class); - metadataSources.addAnnotatedClass(MyProduct.class); - metadataSources.addAnnotatedClass(Pen.class); - metadataSources.addAnnotatedClass(Pet.class); - metadataSources.addAnnotatedClass(Vehicle.class); - - - Metadata metadata = metadataSources.getMetadataBuilder() - .build(); - - return metadata.getSessionFactoryBuilder() - .build(); - - } - - private static ServiceRegistry configureServiceRegistry() throws IOException { - return configureServiceRegistry(getProperties()); - } - - private static ServiceRegistry configureServiceRegistry(Properties properties) throws IOException { - return new StandardServiceRegistryBuilder().applySettings(properties) - .build(); - } - - public static Properties getProperties() throws IOException { - Properties properties = new Properties(); - URL propertiesURL = Thread.currentThread() - .getContextClassLoader() - .getResource(StringUtils.defaultString(PROPERTY_FILE_NAME, "hibernate.properties")); - try (FileInputStream inputStream = new FileInputStream(propertiesURL.getFile())) { - properties.load(inputStream); - } - return properties; - } -} \ No newline at end of file diff --git a/persistence-modules/hibernate5-mapping/src/main/resources/META-INF/persistence.xml b/persistence-modules/hibernate5-mapping/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 474eeb7a44..0000000000 --- a/persistence-modules/hibernate5-mapping/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Hibernate EntityManager Demo - true - - - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/hibernate5-mapping/src/main/resources/logback.xml b/persistence-modules/hibernate5-mapping/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/persistence-modules/hibernate5-mapping/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/hibernate5/README.md b/persistence-modules/hibernate5/README.md index b7a254d836..bd437c80eb 100644 --- a/persistence-modules/hibernate5/README.md +++ b/persistence-modules/hibernate5/README.md @@ -4,8 +4,8 @@ This module contains articles about Hibernate 5. Let's not add more articles her ### Relevant articles: -- [An Overview of Identifiers in Hibernate](http://www.baeldung.com/hibernate-identifiers) -- [Hibernate Interceptors](http://www.baeldung.com/hibernate-interceptor) +- [An Overview of Identifiers in Hibernate](https://www.baeldung.com/hibernate-identifiers) +- [Hibernate Interceptors](https://www.baeldung.com/hibernate-interceptor) - [Hibernate Entity Lifecycle](https://www.baeldung.com/hibernate-entity-lifecycle) - [Hibernate 5 Naming Strategy Configuration](https://www.baeldung.com/hibernate-naming-strategy) - [Proxy in Hibernate load() Method](https://www.baeldung.com/hibernate-proxy-load-method)