All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.cfg.package-info Maven / Gradle / Ivy

There is a newer version: 6.6.3.Final
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
 */

/**
 * This package defines APIs for configuring Hibernate.
 * 
    *
  • {@link org.hibernate.cfg.AvailableSettings} enumerates all the * configuration properties recognized by Hibernate. *
  • {@link org.hibernate.cfg.Configuration} provides a simplified * API for bootstrapping Hibernate, as an alternative to the more * extensive facilities defined under {@link org.hibernate.boot}. *
*

* Note that all the real meat behind these APIs is defined in the package * {@link org.hibernate.boot}. *

* Configuration properties may be specified: *

    *
  • in Java code that {@linkplain org.hibernate.cfg.Configuration#setProperty * configures} Hibernate, *
  • in a JPA configuration file named {@code persistence.xml}, *
  • in a native configuration file named {@code hibernate.cfg.xml}, *
  • in a file named {@code hibernate.properties}, or *
  • using some container-specific configuration facility, for example, * Quarkus configuration properties. *
*

* We now present a couple of example configuration files. * *

Example JPA configuration file

* * The following JPA configuration may be specified in a file named {@code persistence.xml}: * *
{@code 
 *
 *     
 *
 *         org.hibernate.orm.example.Author
 *         org.hibernate.orm.example.Book
 *
 *         
 *
 *             
 *             
 *
 *             
 *             
 *             
 *
 *             
 *             
 *             
 *             
 *
 *             
 *             
 *
 *             
 *             
 *             
 *             
 *
 *         
 *     
 *
 * }
* * The JPA configuration file is necessary when bootstrapping Hibernate via * {@link jakarta.persistence.Persistence#createEntityManagerFactory(java.lang.String)}. * *

Example native configuration file

* * The following configuration may be specified in a file named {@code hibernate.cfg.xml}: * *
{@code 
 * 
 *
 * 
 *     
 *         
 *         jdbc:postgresql://localhost/library
 *
 *         
 *         hibernate
 *         hibernate
 *
 *         
 *         10
 *         PT1s
 *         PT10s
 *
 *         
 *         create
 *
 *         
 *         true
 *         true
 *         true
 *
 *         
 *         10
 *
 *         
 *         
 *         
 *
 *     
 * }
* * The native configuration file is used when configuring Hibernate via * {@link org.hibernate.cfg.Configuration#configure()} or * {@link org.hibernate.boot.registry.StandardServiceRegistryBuilder#configure()}. */ package org.hibernate.cfg;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy