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

The following examples show how to use org.hibernate.boot.model.naming.ImplicitNamingStrategy. These examples are extracted from open source projects. 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 Project: quarkus   Source File: QuarkusStrategySelectorBuilder.java    License: 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 Project: lams   Source File: Ejb3Column.java    License: 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 Project: lams   Source File: SchemaValidatorTask.java    License: 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 Project: lams   Source File: StrategySelectorBuilder.java    License: 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 5
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 6
Source Project: lams   Source File: Configuration.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example 7
@Override
public MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy) {
	delegate.applyImplicitNamingStrategy( namingStrategy );
	return getThis();
}
 
Example 8
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
	return delegate.getImplicitNamingStrategy();
}
 
Example 9
Source Project: lams   Source File: MetadataBuilderImpl.java    License: 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 10
Source Project: lams   Source File: MetadataBuilderImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
	return implicitNamingStrategy;
}
 
Example 11
Source Project: loc-framework   Source File: LocJpaConfiguration.java    License: MIT License 4 votes vote down vote up
NamingStrategiesHibernatePropertiesCustomizer(PhysicalNamingStrategy physicalNamingStrategy,
    ImplicitNamingStrategy implicitNamingStrategy) {
  this.physicalNamingStrategy = physicalNamingStrategy;
  this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example 12
Source Project: spring-analysis-note   Source File: LocalSessionFactoryBean.java    License: 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 13
Source Project: java-technology-stack   Source File: LocalSessionFactoryBean.java    License: 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 Project: lams   Source File: LocalSessionFactoryBean.java    License: 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 15
Source Project: lams   Source File: MetadataBuilder.java    License: 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 16
/**
 * Set a Hibernate 5.0 ImplicitNamingStrategy for the SessionFactory.
 * @see Configuration#setImplicitNamingStrategy
 */
public void setImplicitNamingStrategy(ImplicitNamingStrategy implicitNamingStrategy) {
	this.implicitNamingStrategy = implicitNamingStrategy;
}
 
Example 17
ImplicitNamingStrategy getImplicitNamingStrategy();