mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 08:05:05 +00:00
very minor code changes
This commit is contained in:
parent
8285eba3ac
commit
6536fe0d72
@ -11,8 +11,6 @@
|
|||||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import jakarta.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
import org.hibernate.boot.spi.SessionFactoryOptions;
|
import org.hibernate.boot.spi.SessionFactoryOptions;
|
||||||
import org.hibernate.cache.spi.CacheImplementor;
|
import org.hibernate.cache.spi.CacheImplementor;
|
||||||
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
|
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
|
||||||
import org.hibernate.dialect.Dialect;
|
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||||
import org.hibernate.engine.profile.FetchProfile;
|
import org.hibernate.engine.profile.FetchProfile;
|
||||||
import org.hibernate.event.spi.EventEngine;
|
import org.hibernate.event.spi.EventEngine;
|
||||||
@ -165,7 +164,7 @@ public Set<String> getDefinedFilterNames() {
|
|||||||
return delegate.getDefinedFilterNames();
|
return delegate.getDefinedFilterNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override @Deprecated
|
||||||
public FilterDefinition getFilterDefinition(String filterName) throws HibernateException {
|
public FilterDefinition getFilterDefinition(String filterName) throws HibernateException {
|
||||||
return delegate.getFilterDefinition( filterName );
|
return delegate.getFilterDefinition( filterName );
|
||||||
}
|
}
|
||||||
|
@ -30,5 +30,4 @@ public boolean referenceColumnsInSql(Dialect dialect) {
|
|||||||
public String[] getReferencedColumnValues(Dialect dialect) {
|
public String[] getReferencedColumnValues(Dialect dialect) {
|
||||||
return new String[] { dialect.getIdentityColumnSupport().getIdentityInsertString() };
|
return new String[] { dialect.getIdentityColumnSupport().getIdentityInsertString() };
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -431,6 +431,7 @@ public void setIdentifierGeneratorStrategy(String identifierGeneratorStrategy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@Override
|
||||||
public boolean isIdentityColumn(IdentifierGeneratorFactory identifierGeneratorFactory, Dialect dialect) {
|
public boolean isIdentityColumn(IdentifierGeneratorFactory identifierGeneratorFactory, Dialect dialect) {
|
||||||
return IdentityGenerator.class.isAssignableFrom(
|
return IdentityGenerator.class.isAssignableFrom(
|
||||||
identifierGeneratorFactory.getIdentifierGeneratorClass( identifierGeneratorStrategy )
|
identifierGeneratorFactory.getIdentifierGeneratorClass( identifierGeneratorStrategy )
|
||||||
|
@ -245,8 +245,7 @@ public UnionSubclassEntityPersister(
|
|||||||
|
|
||||||
protected void validateGenerator() {
|
protected void validateGenerator() {
|
||||||
if ( getGenerator() instanceof IdentityGenerator ) {
|
if ( getGenerator() instanceof IdentityGenerator ) {
|
||||||
throw new MappingException( "Cannot use identity column key generation with <union-subclass> mapping for: " + getEntityName()
|
throw new MappingException( "Cannot use identity column key generation with <union-subclass> mapping for: " + getEntityName() );
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,10 +175,12 @@ private static boolean isPrimaryKeyIdentity(Table table, Metadata metadata, Dial
|
|||||||
MetadataImplementor metadataImplementor = (MetadataImplementor) metadata;
|
MetadataImplementor metadataImplementor = (MetadataImplementor) metadata;
|
||||||
return table.hasPrimaryKey()
|
return table.hasPrimaryKey()
|
||||||
&& table.getIdentifierValue() != null
|
&& table.getIdentifierValue() != null
|
||||||
&& table.getIdentifierValue().isIdentityColumn(
|
&& table.getIdentifierValue()
|
||||||
metadataImplementor.getMetadataBuildingOptions().getIdentifierGeneratorFactory(),
|
.isIdentityColumn(
|
||||||
dialect
|
metadataImplementor.getMetadataBuildingOptions()
|
||||||
);
|
.getIdentifierGeneratorFactory(),
|
||||||
|
dialect
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String stripArgs(String string) {
|
private static String stripArgs(String string) {
|
||||||
|
@ -680,6 +680,9 @@ public boolean isNaturalIdentifierInsertGenerated() {
|
|||||||
// Assumptions:
|
// Assumptions:
|
||||||
// * That code checks that there is a natural identifier before making this call, so we assume the same here
|
// * That code checks that there is a natural identifier before making this call, so we assume the same here
|
||||||
// * That code assumes a non-composite natural-id, so we assume the same here
|
// * That code assumes a non-composite natural-id, so we assume the same here
|
||||||
|
if ( naturalIdPropertyNumbers.length < 1 ) {
|
||||||
|
throw new IllegalStateException( "entity does not have a natural id: " + name );
|
||||||
|
}
|
||||||
final Generator strategy = generators[ naturalIdPropertyNumbers[0] ];
|
final Generator strategy = generators[ naturalIdPropertyNumbers[0] ];
|
||||||
return strategy != null && strategy.generatesSometimes();
|
return strategy != null && strategy.generatesSometimes();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user