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

The following examples show how to use org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor#getName() . 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: PersistenceUnitsHolder.java    From quarkus with Apache License 2.0 6 votes vote down vote up
private static Map<String, RecordedState> constructMetadataAdvance(
        final List<PersistenceUnitDescriptor> parsedPersistenceXmlDescriptors, Scanner scanner,
        Collection<Class<? extends Integrator>> additionalIntegrators,
        PreGeneratedProxies proxyClassDefinitions,
        MultiTenancyStrategy strategy) {
    Map<String, RecordedState> recordedStates = new HashMap<>();

    for (PersistenceUnitDescriptor unit : parsedPersistenceXmlDescriptors) {
        RecordedState m = createMetadata(unit, scanner, additionalIntegrators, proxyClassDefinitions, strategy);
        Object previous = recordedStates.put(unitName(unit), m);
        if (previous != null) {
            throw new IllegalStateException("Duplicate persistence unit name: " + unit.getName());
        }
    }

    return recordedStates;
}
 
Example 2
Source File: PersistenceUnitsHolder.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static String unitName(PersistenceUnitDescriptor unit) {
    String name = unit.getName();
    if (name == null) {
        return NO_NAME_TOKEN;
    }
    return name;
}
 
Example 3
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 4
Source File: Helper.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private static String getExceptionHeader(PersistenceUnitDescriptor persistenceUnit) {
	return "[PersistenceUnit: " + persistenceUnit.getName() + "] ";
}