|
Hibernate example source code file (AvailableSettings.java)
The Hibernate AvailableSettings.java source code/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.ejb; /** * Defines the available HEM settings, both JPA-defined as well as Hibernate-specific * <p/> * NOTE : Does *not* include {@link org.hibernate.cfg.Environment} values. * * @author Steve Ebersole */ public class AvailableSettings { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // JPA defined settings // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * THe name of the {@link javax.persistence.spi.PersistenceProvider} implementor * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.4 */ public static final String PROVIDER = "javax.persistence.provider"; /** * The type of transactions supported by the entity managers. * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.2 */ public static final String TRANSACTION_TYPE = "javax.persistence.transactionType"; /** * The JNDI name of a JTA {@link javax.sql.DataSource}. * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.5 */ public static final String JTA_DATASOURCE = "javax.persistence.jtaDataSource"; /** * The JNDI name of a non-JTA {@link javax.sql.DataSource}. * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.5 */ public static final String NON_JTA_DATASOURCE = "javax.persistence.nonJtaDataSource"; /** * The name of a JDBC driver to use to connect to the database. * <p/> * Used in conjunction with {@link #JDBC_URL}, {@link #JDBC_USER} and {@link #JDBC_PASSWORD} * to define how to make connections to the database in lieu of * a datasource (either {@link #JTA_DATASOURCE} or {@link #NON_JTA_DATASOURCE}). * <p/> * See section 8.2.1.9 */ public static final String JDBC_DRIVER = "javax.persistence.jdbc.driver"; /** * The JDBC connection url to use to connect to the database. * <p/> * Used in conjunction with {@link #JDBC_DRIVER}, {@link #JDBC_USER} and {@link #JDBC_PASSWORD} * to define how to make connections to the database in lieu of * a datasource (either {@link #JTA_DATASOURCE} or {@link #NON_JTA_DATASOURCE}). * <p/> * See section 8.2.1.9 */ public static final String JDBC_URL = "javax.persistence.jdbc.url"; /** * The JDBC connection user name. * <p/> * Used in conjunction with {@link #JDBC_DRIVER}, {@link #JDBC_URL} and {@link #JDBC_PASSWORD} * to define how to make connections to the database in lieu of * a datasource (either {@link #JTA_DATASOURCE} or {@link #NON_JTA_DATASOURCE}). * <p/> * See section 8.2.1.9 */ public static final String JDBC_USER = "javax.persistence.jdbc.user"; /** * The JDBC connection password. * <p/> * Used in conjunction with {@link #JDBC_DRIVER}, {@link #JDBC_URL} and {@link #JDBC_USER} * to define how to make connections to the database in lieu of * a datasource (either {@link #JTA_DATASOURCE} or {@link #NON_JTA_DATASOURCE}). * <p/> * See JPA 2 section 8.2.1.9 */ public static final String JDBC_PASSWORD = "javax.persistence.jdbc.password"; /** * Used to indicate whether second-level (what JPA terms shared cache) caching is * enabled as per the rules defined in JPA 2 section 3.1.7. * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.7 * @see javax.persistence.SharedCacheMode */ public static final String SHARED_CACHE_MODE = "javax.persistence.sharedCache.mode"; /** * NOTE : Not a valid EMF property... * <p/> * Used to indicate if the provider should attempt to retrieve requested data * in the shared cache. * * @see javax.persistence.CacheRetrieveMode */ public static final String SHARED_CACHE_RETRIEVE_MODE ="javax.persistence.cache.retrieveMode"; /** * NOTE : Not a valid EMF property... * <p/> * Used to indicate if the provider should attempt to store data loaded from the database * in the shared cache. * * @see javax.persistence.CacheStoreMode */ public static final String SHARED_CACHE_STORE_MODE ="javax.persistence.cache.storeMode"; /** * Used to indicate what form of automatic validation is in effect as per rules defined * in JPA 2 section 3.6.1.1 * <p/> * See JPA 2 sections 9.4.3 and 8.2.1.8 * @see javax.persistence.ValidationMode */ public static final String VALIDATION_MODE = "javax.persistence.validation.mode"; /** * Used to pass along any discovered validator factory. */ public static final String VALIDATION_FACTORY = "javax.persistence.validation.factory"; /** * Used to request (hint) a pessimistic lock scope. * <p/> * See JPA 2 sections 8.2.1.9 and 3.4.4.3 */ public static final String LOCK_SCOPE = "javax.persistence.lock.scope"; /** * Used to request (hint) a pessimistic lock timeout (in milliseconds). * <p/> * See JPA 2 sections 8.2.1.9 and 3.4.4.3 */ public static final String LOCK_TIMEOUT = "javax.persistence.lock.timeout"; /** * Used to coordinate with bean validators * <p/> * See JPA 2 section 8.2.1.9 */ public static final String PERSIST_VALIDATION_GROUP = "javax.persistence.validation.group.pre-persist"; /** * Used to coordinate with bean validators * <p/> * See JPA 2 section 8.2.1.9 */ public static final String UPDATE_VALIDATION_GROUP = "javax.persistence.validation.group.pre-update"; /** * Used to coordinate with bean validators * <p/> * See JPA 2 section 8.2.1.9 */ public static final String REMOVE_VALIDATION_GROUP = "javax.persistence.validation.group.pre-remove"; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Hibernate specific settings // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Query hint (aka {@link javax.persistence.Query#setHint}) for applying * an alias specific lock mode (aka {@link org.hibernate.Query#setLockMode}). * <p/> * Either {@link org.hibernate.LockMode} or {@link javax.persistence.LockModeType} * are accepted. Also the String names of either are accepted as well. <tt>null * is additionally accepted as meaning {@link org.hibernate.LockMode#NONE}. * <p/> * Usage is to concatenate this setting name and the alias name together, separated * by a dot. For example<code>Query.setHint( "org.hibernate.lockMode.a", someLockMode ) * would apply <code>someLockMode to the alias Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate AvailableSettings.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.