org.hibernate.boot.model.naming.ImplicitNamingStrategy Java Examples

The following examples show how to use org.hibernate.boot.model.naming.ImplicitNamingStrategy. 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: QuarkusStrategySelectorBuilder.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static void addImplicitNamingStrategies(StrategySelectorImpl strategySelector) {
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "default",
            ImplicitNamingStrategyJpaCompliantImpl.class);
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "jpa",
            ImplicitNamingStrategyJpaCompliantImpl.class);
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "component-path",
            ImplicitNamingStrategyComponentPathImpl.class);
}
 
Example #2
Source File: Ejb3Column.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
protected void addColumnBinding(SimpleValue value) {
	final String logicalColumnName;
	if ( StringHelper.isNotEmpty( this.logicalColumnName ) ) {
		logicalColumnName = this.logicalColumnName;
	}
	else {
		final ObjectNameNormalizer normalizer = context.getObjectNameNormalizer();
		final Database database = context.getMetadataCollector().getDatabase();
		final ImplicitNamingStrategy implicitNamingStrategy = context.getBuildingOptions()
				.getImplicitNamingStrategy();

		final Identifier implicitName = normalizer.normalizeIdentifierQuoting(
				implicitNamingStrategy.determineBasicColumnName(
						new ImplicitBasicColumnNameSource() {
							@Override
							public AttributePath getAttributePath() {
								return AttributePath.parse( propertyName );
							}

							@Override
							public boolean isCollectionElement() {
								return false;
							}

							@Override
							public MetadataBuildingContext getBuildingContext() {
								return context;
							}
						}
				)
		);
		logicalColumnName = implicitName.render( database.getDialect() );
	}
	context.getMetadataCollector().addColumnNameBinding( value.getTable(), logicalColumnName, getMappingColumn() );
}
 
Example #3
Source File: SchemaValidatorTask.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
private void configure(MetadataBuilder metadataBuilder, StandardServiceRegistry serviceRegistry) {
	final StrategySelector strategySelector = serviceRegistry.getService( StrategySelector.class );
	if ( implicitNamingStrategy != null ) {
		metadataBuilder.applyImplicitNamingStrategy(
				strategySelector.resolveStrategy( ImplicitNamingStrategy.class, implicitNamingStrategy )
		);
	}
	if ( physicalNamingStrategy != null ) {
		metadataBuilder.applyPhysicalNamingStrategy(
				strategySelector.resolveStrategy( PhysicalNamingStrategy.class, physicalNamingStrategy )
		);
	}
}
 
Example #4
Source File: EntityManagerFactoryServiceImpl.java    From multitenant with Apache License 2.0 5 votes vote down vote up
public EntityManagerFactoryServiceImpl(
		ObjectProvider<List<SchemaManagementProvider>> providers,
		ObjectProvider<PhysicalNamingStrategy> physicalNamingStrategy,
		ObjectProvider<ImplicitNamingStrategy> implicitNamingStrategy,
		ObjectProvider<List<HibernatePropertiesCustomizer>> hibernatePropertiesCustomizers) {
	this.defaultDdlAutoProvider = new HibernateDefaultDdlAutoProvider(
			providers.getIfAvailable(Collections::emptyList));
	this.physicalNamingStrategy = physicalNamingStrategy.getIfAvailable();
	this.implicitNamingStrategy = implicitNamingStrategy.getIfAvailable();
	this.hibernatePropertiesCustomizers = hibernatePropertiesCustomizers
			.getIfAvailable(() -> Collections.emptyList());
}
 
Example #5
Source File: StrategySelectorBuilder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void addImplicitNamingStrategies(StrategySelectorImpl strategySelector) {
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"default",
			ImplicitNamingStrategyJpaCompliantImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"jpa",
			ImplicitNamingStrategyJpaCompliantImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"legacy-jpa",
			ImplicitNamingStrategyLegacyJpaImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"legacy-hbm",
			ImplicitNamingStrategyLegacyHbmImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"component-path",
			ImplicitNamingStrategyComponentPathImpl.class
	);
}
 
Example #6
Source File: LocJpaConfiguration.java    From loc-framework with MIT License 4 votes vote down vote up
NamingStrategiesHibernatePropertiesCustomizer(PhysicalNamingStrategy physicalNamingStrategy,
    ImplicitNamingStrategy implicitNamingStrategy) {
  this.physicalNamingStrategy = physicalNamingStrategy;
  this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #7
Source File: Configuration.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #8
Source File: AbstractDelegatingMetadataBuilderImplementor.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy) {
	delegate.applyImplicitNamingStrategy( namingStrategy );
	return getThis();
}
 
Example #9
Source File: AbstractDelegatingMetadataBuildingOptions.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
	return delegate.getImplicitNamingStrategy();
}
 
Example #10
Source File: MetadataBuilderImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy) {
	this.options.implicitNamingStrategy = namingStrategy;
	return this;
}
 
Example #11
Source File: MetadataBuilderImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
	return implicitNamingStrategy;
}
 
Example #12
Source File: LocalSessionFactoryBean.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Set a Hibernate 5.0 ImplicitNamingStrategy for the SessionFactory.
 * @see Configuration#setImplicitNamingStrategy
 */
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #13
Source File: LocalSessionFactoryBean.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Set a Hibernate 5 {@link ImplicitNamingStrategy} for the SessionFactory.
 * @see Configuration#setImplicitNamingStrategy
 */
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #14
Source File: MetadataBuilder.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Specify the ImplicitNamingStrategy to use in building the Metadata.
 * <p/>
 * Its default is defined by the {@link org.hibernate.cfg.AvailableSettings#IMPLICIT_NAMING_STRATEGY}
 * setting if using property-based configuration.
 *
 * @param namingStrategy The ImplicitNamingStrategy to apply
 *
 * @return {@code this}, for method chaining
 *
 * @see org.hibernate.cfg.AvailableSettings#IMPLICIT_NAMING_STRATEGY
 */
MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy);
 
Example #15
Source File: LocalSessionFactoryBean.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Set a Hibernate 5.0 ImplicitNamingStrategy for the SessionFactory.
 * @see Configuration#setImplicitNamingStrategy
 */
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #16
Source File: LocalSessionFactoryBean.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Set a Hibernate 5 {@link ImplicitNamingStrategy} for the SessionFactory.
 * @see Configuration#setImplicitNamingStrategy
 */
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example #17
Source File: MetadataBuildingOptions.java    From lams with GNU General Public License v2.0 votes vote down vote up
ImplicitNamingStrategy getImplicitNamingStrategy();