Spec-Zone .ru
спецификации, руководства, описания, API


javax.persistence.spi
Интерфейс PersistenceUnitInfo


public interface PersistenceUnitInfo

Интерфейс, реализованный контейнером и используемый провайдером персистентности, создавая EntityManagerFactory.

С тех пор:
Персистентность Java 1.0

Сводка метода
 void addTransformer(ClassTransformer transformer)
          Добавьте преобразователь, предоставленный провайдером, которого вызовут для каждого нового определения class или переопределения class, которое загружается загрузчиком, возвращенным PersistenceUnitInfo#getClassLoader метод.
 boolean excludeUnlistedClasses()
          Возвраты, должны ли классы в корне модуля персистентности, которые не были явно перечислены, быть включены в набор управляемых классов.
 java.lang.ClassLoader getClassLoader()
          ClassLoder возвратов, который провайдер может использовать, чтобы загрузить любые классы, ресурсы, или открыть URL.
 java.util.List<java.net.URL> getJarFileUrls()
          Возвращает список URL для файлов фляги или взорванных каталогов файла фляги, которые провайдер персистентности должен исследовать на управляемые классы модуля персистентности.
 javax.sql.DataSource getJtaDataSource()
          Возвращает JTA-поддерживающий источник данных, который будет использоваться провайдером персистентности.
 java.util.List<java.lang.String> getManagedClassNames()
          Возвращает список имен классов, которые провайдер персистентности должен добавить к его набору управляемых классов.
 java.util.List<java.lang.String> getMappingFileNames()
          Возвращает список имен отображающихся файлов, которые провайдер персистентности должен загрузить, чтобы определить отображения для классов объекта.
 java.lang.ClassLoader getNewTempClassLoader()
          Возвратите новый экземпляр ClassLoder, который провайдер может использовать, чтобы временно загрузить любые классы, ресурсы, или открыть URL.
 javax.sql.DataSource getNonJtaDataSource()
          Возвращает non-JTA-enabled источник данных, который будет использоваться провайдером персистентности для того, чтобы получить доступ к данным вне транзакции JTA.
 java.lang.String getPersistenceProviderClassName()
          Возвращает полностью определенное имя реализации провайдера персистентности class.
 java.lang.String getPersistenceUnitName()
          Возвращает имя модуля персистентности.
 java.net.URL getPersistenceUnitRootUrl()
          Возвращает URL для файла или каталога фляги, который является корнем модуля персистентности.
 java.lang.String getPersistenceXMLSchemaVersion()
          Возвращает версию схемы persistence.xml файл.
 java.util.Properties getProperties()
          Возвращает объект свойств.
 SharedCacheMode getSharedCacheMode()
          Возвращает спецификацию того, как провайдер должен использовать кэш второго уровня для модуля персистентности.
 PersistenceUnitTransactionType getTransactionType()
          Возвращает тип транзакции менеджеров по объекту, создаваемых EntityManagerFactory.
 ValidationMode getValidationMode()
          Возвращает режим проверки допустимости, который будет использоваться провайдером персистентности для модуля персистентности.
 

Деталь метода

getPersistenceUnitName

java.lang.String getPersistenceUnitName()
Возвращает имя модуля персистентности. Соответствует name атрибут в persistence.xml file.

Returns:
the name of the persistence unit

getPersistenceProviderClassName

java.lang.String getPersistenceProviderClassName()
Returns the fully qualified name of the persistence provider implementation class. Corresponds to the provider element in the persistence.xml file.

Returns:
the fully qualified name of the persistence provider implementation class

getTransactionType

PersistenceUnitTransactionType getTransactionType()
Returns the transaction type of the entity managers created by the EntityManagerFactory. The transaction type corresponds to the transaction-type attribute in the persistence.xml file.

Returns:
transaction type of the entity managers created by the EntityManagerFactory

getJtaDataSource

javax.sql.DataSource getJtaDataSource()
Returns the JTA-enabled data source to be used by the persistence provider. The data source corresponds to the jta-data-source element in the persistence.xml file or is provided at deployment or by the container.

Returns:
the JTA-enabled data source to be used by the persistence provider

getNonJtaDataSource

javax.sql.DataSource getNonJtaDataSource()
Returns the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. The data source corresponds to the named non-jta-data-source element in the persistence.xml file or provided at deployment or by the container.

Returns:
the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction

getMappingFileNames

java.util.List<java.lang.String> getMappingFileNames()
Returns the list of the names of the mapping files that the persistence provider must load to determine the mappings for the entity classes. The mapping files must be in the standard XML mapping format, be uniquely named and be resource-loadable from the application classpath. Each mapping file name corresponds to a mapping-file element in the persistence.xml file.

Returns:
the list of mapping file names that the persistence provider must load to determine the mappings for the entity classes

getJarFileUrls

java.util.List<java.net.URL> getJarFileUrls()
Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit. Each URL corresponds to a jar-file element in the persistence.xml file. A URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:
a list of URL objects referring to jar files or directories

getPersistenceUnitRootUrl

java.net.URL getPersistenceUnitRootUrl()
Returns the URL for the jar file or directory that is the root of the persistence unit. (If the persistence unit is rooted in the WEB-INF/classes directory, this will be the URL of that directory.) The URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:
a URL referring to a jar file or directory

getManagedClassNames

java.util.List<java.lang.String> getManagedClassNames()
Returns the list of the names of the classes that the persistence provider must add to its set of managed classes. Each name corresponds to a named class element in the persistence.xml file.

Returns:
the list of the names of the classes that the persistence provider must add to its set of managed classes

excludeUnlistedClasses

boolean excludeUnlistedClasses()
Returns whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. This value corresponds to the exclude-unlisted-classes element in the persistence.xml file.

Returns:
whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes

getSharedCacheMode

SharedCacheMode getSharedCacheMode()
Returns the specification of how the provider must use a second-level cache for the persistence unit. The result of this method corresponds to the shared-cache-mode element in the persistence.xml file.

Returns:
the second-level cache mode that must be used by the provider for the persistence unit
Since:
Java Persistence 2.0

getValidationMode

ValidationMode getValidationMode()
Returns the validation mode to be used by the persistence provider for the persistence unit. The validation mode corresponds to the validation-mode element in the persistence.xml file.

Returns:
the validation mode to be used by the persistence provider for the persistence unit
Since:
Java Persistence 2.0

getProperties

java.util.Properties getProperties()
Returns a properties object. Each property corresponds to a property element in the persistence.xml file.

Returns:
Properties object

getPersistenceXMLSchemaVersion

java.lang.String getPersistenceXMLSchemaVersion()
Returns the schema version of the persistence.xml file.

Returns:
persistence.xml schema version
Since:
Java Persistence 2.0

getClassLoader

java.lang.ClassLoader getClassLoader()
Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.

Returns:
ClassLoader that the provider may use to load any classes, resources, or open URLs

addTransformer

void addTransformer(ClassTransformer transformer)
Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceUnitInfo#getClassLoader method. The transformer has no effect on the result returned by the PersistenceUnitInfo#getNewTempClassLoader method. Classes are only transformed once within the same classloading scope, regardless of how many persistence units they may be a part of.

Parameters:
transformer - provider-supplied transformer that the container invokes at class-(re)definition time

getNewTempClassLoader

java.lang.ClassLoader getNewTempClassLoader()
Return a new instance of a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs. The scope and classpath of this loader is exactly the same as that of the loader returned by PersistenceUnitInfo#getClassLoader. None of the classes loaded by this class loader will be visible to application components. The provider may only use this ClassLoader within the scope of the PersistenceProvider#createContainerEntityManagerFactory call.

Returns:
temporary ClassLoader with same visibility as current loader


Представьте ошибку или функцию

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

free hit counter