Skip to content

Commit

Permalink
#67 - Coordinate JPA 3.2 work in ORM
Browse files Browse the repository at this point in the history
- remove local `hibernate-orm` module
- add dependency on `hibernate-core:7.0.0-SNAPSHOT`
  • Loading branch information
sebersole committed Nov 9, 2023
1 parent 23a8b07 commit c693502
Show file tree
Hide file tree
Showing 106 changed files with 23 additions and 7,947 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.hibernate.models.internal;

import java.lang.instrument.UnmodifiableClassException;
import java.net.URL;

import org.hibernate.models.spi.ClassLoading;
Expand Down
10 changes: 8 additions & 2 deletions hibernate-models-orm/hibernate-models-orm.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
apply from: rootProject.file( "gradle/java-module.gradle" )

configurations.api {
// temporarily limit caching for hibernate-core SNAPSHOT
resolutionStrategy.cacheChangingModulesFor 10, 'minutes'
}

dependencies {
api platform( libs.hibernatePlatform )
api libs.hibernateCore

implementation project( ":hibernate-models-common" )
implementation project( ":hibernate-models-source" )

implementation project( ":hibernate-orm" )
implementation libs.jandex
implementation libs.byteBuddy
implementation libs.classmate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public void collectFilterDefinitions(List<JaxbFilterDefImpl> filterDefinitions)

filterDefinitions.forEach( (filterDefinition) -> collectFilterDefinition(
filterDefinition.getName(),
filterDefinition.getCondition(),
filterDefinition.getDefaultCondition(),
extractFilterParameters( filterDefinition )
) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public static void applyUserType(
final DynamicAnnotationUsage<Type> typeAnn = new DynamicAnnotationUsage<>( Type.class, memberDetails );
memberDetails.addAnnotationUsage( typeAnn );

final ClassDetails userTypeImpl = resolveJavaType( jaxbType.getType(), buildingContext );
final ClassDetails userTypeImpl = resolveJavaType( jaxbType.getValue(), buildingContext );
typeAnn.setAttributeValue( "value", userTypeImpl );
typeAnn.setAttributeValue( "parameters", collectParameters( jaxbType.getParameters(), memberDetails ) );
}
Expand Down Expand Up @@ -904,8 +904,8 @@ static <A extends Annotation> void applyCustomSql(
annotation.setAttributeValue( "sql", jaxbCustomSql.getValue() );
annotation.setAttributeValue( "callable", jaxbCustomSql.isCallable() );
applyAttributeIfSpecified( annotation, "table", jaxbCustomSql.getTable() );
if ( jaxbCustomSql.getCheck() != null ) {
annotation.setAttributeValue( "check", getResultCheckStyle( jaxbCustomSql.getCheck() ) );
if ( jaxbCustomSql.getResultCheck() != null ) {
annotation.setAttributeValue( "check", getResultCheckStyle( jaxbCustomSql.getResultCheck() ) );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package org.hibernate.models.orm.categorize.xml.spi;

import org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappingsImpl;
import org.hibernate.boot.jaxb.spi.BindableMappingDescriptor;
import org.hibernate.boot.jaxb.spi.JaxbBindableMappingDescriptor;
import org.hibernate.boot.jaxb.spi.Binding;
import org.hibernate.boot.model.process.spi.ManagedResources;
import org.hibernate.models.orm.categorize.xml.internal.XmlPreProcessingResultImpl;
Expand All @@ -26,7 +26,7 @@ public class XmlPreProcessor {
public static XmlPreProcessingResult preProcessXmlResources(ManagedResources managedResources) {
final XmlPreProcessingResultImpl collected = new XmlPreProcessingResultImpl();

for ( Binding<BindableMappingDescriptor> mappingXmlBinding : managedResources.getXmlMappingBindings() ) {
for ( Binding<JaxbBindableMappingDescriptor> mappingXmlBinding : managedResources.getXmlMappingBindings() ) {
collected.addDocument( (JaxbEntityMappingsImpl) mappingXmlBinding.getRoot() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.hibernate.boot.jaxb.Origin;
import org.hibernate.boot.jaxb.SourceType;
import org.hibernate.boot.jaxb.internal.MappingBinder;
import org.hibernate.boot.jaxb.spi.BindableMappingDescriptor;
import org.hibernate.boot.jaxb.spi.Binding;
import org.hibernate.boot.jaxb.spi.JaxbBindableMappingDescriptor;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
Expand Down Expand Up @@ -59,7 +58,7 @@ public Collection<String> getAnnotatedPackageNames() {
}

@Override
public Collection<Binding<BindableMappingDescriptor>> getXmlMappingBindings() {
public Collection<Binding<JaxbBindableMappingDescriptor>> getXmlMappingBindings() {
if ( xmlMappings == null ) {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
-->
<entity-mappings xmlns="http://www.hibernate.org/xsd/orm/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="3.1">
version="3.2">
<entity class="org.hibernate.models.orm.xml.SimpleEntity" metadata-complete="true" access="FIELD">
<sql-restriction>name is not null</sql-restriction>
<sql-insert callable="true" check="rowcount" table="SimpleEntity">insert into SimpleEntity(name) values(?)</sql-insert>
<filter name="name_filter" condition="{t}.name = :name">
<sql-insert callable="true" result-check="COUNT" table="SimpleEntity">insert into SimpleEntity(name) values(?)</sql-insert>
<filter name="name_filter">
<condition>{t}.name = :name</condition>
<aliases alias="t" table="SimpleEntity" entity="org.hibernate.models.orm.xml.SimpleEntity"/>
</filter>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<target>Integer</target>
<jdbc-type-name>BIGINT</jdbc-type-name>
</id>
<element-collection name="labels" target-class="string" classification="set">
<element-collection name="labels" target-class="string" classification="SET">
<sort-natural/>
<collection-table name="labels">
<join-column name="contact_fk"/>
Expand Down
6 changes: 3 additions & 3 deletions hibernate-models-orm/src/test/resources/mappings/globals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<entity-mappings xmlns="http://www.hibernate.org/xsd/orm/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="3.1">
version="3.2">
<persistence-unit-metadata>
<persistence-unit-defaults>
<entity-listeners>
Expand All @@ -25,11 +25,11 @@
<conversion converter="org.hibernate.type.YesNoConverter" class="boolean" auto-apply="true"/>

<filter-def name="amount_filter">
<default-condition>amount = :amount</default-condition>
<filter-param name="amount" type="int"/>
<condition>amount = :amount</condition>
</filter-def>
<filter-def name="name_filter">
<default-condition>name = :name</default-condition>
<filter-param name="name" type="string"/>
<condition>name = :name</condition>
</filter-def>
</entity-mappings>
45 changes: 0 additions & 45 deletions hibernate-orm/hibernate-orm.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c693502

Please sign in to comment.