Java Code Examples for org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor#getProperties()

The following examples show how to use org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor#getProperties() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LightPersistenceXmlDescriptor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
public LightPersistenceXmlDescriptor(final PersistenceUnitDescriptor toClone) {
    this.name = toClone.getName();
    this.providerClassName = toClone.getProviderClassName();
    this.useQuotedIdentifiers = toClone.isUseQuotedIdentifiers();
    this.transactionType = toClone.getTransactionType();
    this.validationMode = toClone.getValidationMode();
    this.sharedCachemode = toClone.getSharedCacheMode();
    this.managedClassNames = Collections.unmodifiableList(toClone.getManagedClassNames());
    this.properties = toClone.getProperties();
    verifyIgnoredFields(toClone);
}
 
Example 2
Source File: LogHelper.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public static void logPersistenceUnitInformation(PersistenceUnitDescriptor descriptor) {
	if ( ! log.isDebugEnabled() ) {
		log.processingPersistenceUnitInfoName( descriptor.getName() );
		return;
	}

	StringBuilder sb = new StringBuilder();
	sb.append( "PersistenceUnitInfo [\n\t" )
			.append( "name: " )
			.append( descriptor.getName() )
			.append( "\n\t" )
			.append( "persistence provider classname: " )
			.append( descriptor.getProviderClassName() )
			.append( "\n\t" )
			.append( "classloader: " )
			.append( descriptor.getClassLoader() )
			.append( "\n\t" )
			.append( "excludeUnlistedClasses: " )
			.append( descriptor.isExcludeUnlistedClasses() )
			.append( "\n\t" )
			.append( "JTA datasource: " )
			.append( descriptor.getJtaDataSource() )
			.append( "\n\t" )
			.append( "Non JTA datasource: " )
			.append( descriptor.getNonJtaDataSource() )
			.append( "\n\t" )
			.append( "Transaction type: " )
			.append( descriptor.getTransactionType() )
			.append( "\n\t" )
			.append( "PU root URL: " )
			.append( descriptor.getPersistenceUnitRootUrl() )
			.append( "\n\t" )
			.append( "Shared Cache Mode: " )
			.append( descriptor.getSharedCacheMode() )
			.append( "\n\t" )
			.append( "Validation Mode: " )
			.append( descriptor.getValidationMode() )
			.append( "\n\t" );
	sb.append( "Jar files URLs [" );
	List<URL> jarFileUrls = descriptor.getJarFileUrls();
	if ( jarFileUrls != null ) {
		for ( URL url : jarFileUrls ) {
			sb.append( "\n\t\t" ).append( url );
		}
	}
	sb.append( "]\n\t" );
	sb.append( "Managed classes names [" );
	List<String> classNames = descriptor.getManagedClassNames();
	if ( classNames != null ) {
		for ( String className : classNames ) {
			sb.append( "\n\t\t" ).append( className );
		}
	}
	sb.append( "]\n\t" );
	sb.append( "Mapping files names [" );
	List<String> mappingFiles = descriptor.getMappingFileNames();
	if ( mappingFiles != null ) {
		for ( String file : mappingFiles ) {
			sb.append( "\n\t\t" ).append( file );
		}
	}
	sb.append( "]\n\t" );
	sb.append( "Properties [" );
	Properties properties = descriptor.getProperties();
	if (properties != null) {
		Enumeration names = properties.propertyNames();
		while ( names.hasMoreElements() ) {
			String name = (String) names.nextElement();
			sb.append( "\n\t\t" ).append( name ).append( ": " ).append( properties.getProperty( name ) );
		}
	}
	sb.append( "]" );

	log.debug( sb.toString() );
}