This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch 9.0.x-h7-improvement-phase3
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 24a0fcb346e650895bfbe85b591c98a698c6ccbc
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Thu Oct 8 01:03:25 2026 -0500

    feat: accept an attribute converter class as the type in native domain 
binding
    
    The generator refused type: 'org.hibernate.type.YesNoConverter' because 
@Type cannot name a class
    that is not a UserType. The domain binder accepts it: it resolves the name 
to the converter and
    binds the property with it, on a simple property (char(1), a Boolean stored 
as Y or N and read back)
    and on a hasMany stored in one column (the collection becomes one char(1) 
column of the owner),
    without checking that the converter accepts the property's class. A String 
with that converter
    boots and fails only when it is used.
    
    The generator now states it with @Convert and no JDBC type, which the 
converter resolves itself to
    the same column type. When the property's class is not one the converter 
converts, the generated
    field has the type the converter converts, so Hibernate boots as the domain 
binder does. Both
    bindings are compared on the schema and on a Boolean saved, queried and 
read back.
    
    Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
 .../domainbinding/jpa/GrailsDomainGenerator.groovy |  33 +++-
 .../cfg/domainbinding/jpa/TypeFacets.groovy        |  11 +-
 ...GeneratedDomainClassesConverterClassSpec.groovy | 175 +++++++++++++++++++++
 ...eneratedDomainClassesDdlDifferentialSpec.groovy |   1 -
 .../GrailsDomainGeneratorDifferentialSpec.groovy   |   5 +-
 .../jpa/GrailsDomainGeneratorSpec.groovy           |  27 +++-
 .../advancedGORMFeatures/nativeDomainBinding.adoc  |   7 +-
 7 files changed, 240 insertions(+), 19 deletions(-)

diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGenerator.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGenerator.groovy
index 4d51fe6691..bdc2e5568b 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGenerator.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGenerator.groovy
@@ -118,6 +118,7 @@ import org.hibernate.type.spi.TypeConfiguration
 import org.hibernate.usertype.UserCollectionType
 import org.hibernate.usertype.UserType
 
+import org.springframework.core.GenericTypeResolver
 import org.springframework.util.ClassUtils
 
 import org.grails.datastore.mapping.model.config.GormProperties
@@ -1100,10 +1101,14 @@ class GrailsDomainGenerator {
         }
         Class<?> named = loadClass(name, property)
         if (named != null) {
-            return UserType.isAssignableFrom(named) ?
-                    new TypeDecision(true, name, new TypeFacets(named, null, 
parameters)) :
-                    new TypeDecision(false, name, null, 'names a class that is 
not a UserType (an AttributeConverter, for example), which ' +
-                            '@Type cannot name')
+            if (UserType.isAssignableFrom(named)) {
+                return new TypeDecision(true, name, new TypeFacets(named, 
null, parameters))
+            }
+            if (AttributeConverter.isAssignableFrom(named) && !isEnum) {
+                return convertedType(name, named, type)
+            }
+            return new TypeDecision(false, name, null, 'names a class that is 
neither a UserType nor an AttributeConverter, which ' +
+                    '@Type and @Convert cannot name')
         }
         BasicType<?> registered = 
typeConfiguration.basicTypeRegistry.getRegisteredType(name)
         boolean identity = property instanceof HibernateSimpleIdentityProperty
@@ -1154,6 +1159,18 @@ class GrailsDomainGenerator {
         return registeredJava.interface && type != null && 
registeredJava.isAssignableFrom(boxed(type))
     }
 
+    /**
+     * A {@code type} naming an {@code AttributeConverter}: the binder 
resolves the name to the converter and binds the property with it,
+     * whatever the property's class is. {@code @Convert} states it, on a 
field of the Java type the converter converts when the
+     * property's class is not one the converter accepts (the binder does not 
check, Hibernate does).
+     */
+    private static TypeDecision convertedType(String name, Class<?> converter, 
Class<?> type) {
+        Class<?>[] arguments = 
GenericTypeResolver.resolveTypeArguments(converter, AttributeConverter)
+        Class<?> domain = arguments != null ? arguments[0] : null
+        Class<?> javaType = domain != null && (type == null || 
!domain.isAssignableFrom(boxed(type))) ? domain : null
+        return new TypeDecision(true, name, new TypeFacets(null, null, [:], 
javaType, converter))
+    }
+
     private static Class<?> loadClass(String name, HibernatePersistentProperty 
property) {
         for (ClassLoader loader : 
[property.hibernateOwner.javaClass.classLoader, 
Thread.currentThread().contextClassLoader]) {
             try {
@@ -3088,8 +3105,12 @@ class GrailsDomainGenerator {
 
     private static List<AnnotationDescription> typeAnnotations(TypeFacets 
facets) {
         if (facets.converter() != null) {
-            return 
[AnnotationDescription.Builder.ofType(Convert).define('converter', 
TypeDescription.ForLoadedType.of(facets.converter())).build(),
-                    
AnnotationDescription.Builder.ofType(JdbcTypeCode).define('value', 
facets.jdbcTypeCode().intValue()).build()]
+            List<AnnotationDescription> converted = 
[AnnotationDescription.Builder.ofType(Convert)
+                    .define('converter', 
TypeDescription.ForLoadedType.of(facets.converter())).build()]
+            if (facets.jdbcTypeCode() != null) {
+                converted << 
AnnotationDescription.Builder.ofType(JdbcTypeCode).define('value', 
facets.jdbcTypeCode().intValue()).build()
+            }
+            return converted
         }
         if (facets.jdbcTypeCode() != null) {
             return 
[AnnotationDescription.Builder.ofType(JdbcTypeCode).define('value', 
facets.jdbcTypeCode().intValue()).build()]
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/TypeFacets.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/TypeFacets.groovy
index 976e77ff24..e84c05b2fb 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/TypeFacets.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/TypeFacets.groovy
@@ -27,10 +27,13 @@ import groovy.transform.CompileStatic
  * value, such as {@code yes_no} ({@code @Convert} together with the {@code 
@JdbcTypeCode} of the registered type, which can differ
  * from the one the converter alone resolves to: {@code numeric_boolean} is a 
TINYINT, the converter alone an INTEGER).
  *
- * <p>Exactly one of {@code userType} and {@code jdbcTypeCode} is set, and 
{@code converter} only next to {@code jdbcTypeCode}. {@code parameters} is only 
meaningful for a
- * user type and is never {@code null}. {@code javaType} is the Java type the 
registered type maps when it is not the
- * property's own, which only an identifier can have (its value comes from a 
generator, so the mapping may name a type for a
- * value the property's class does not hold); the generated field then has 
that type.</p>
+ * <p>A converter named by its class ({@code type: 
'org.hibernate.type.YesNoConverter'}) is {@code converter} alone: no {@code 
userType} and no
+ * {@code jdbcTypeCode}, which the converter resolves itself. Otherwise 
exactly one of {@code userType} and {@code jdbcTypeCode} is set, and
+ * {@code converter} only next to {@code jdbcTypeCode}. {@code parameters} is 
only meaningful for a user type and is never {@code null}.
+ * {@code javaType} is the Java type the generated field has when it is not 
the property's own: the type a registered type maps for an
+ * identifier (its value comes from a generator, so the mapping may name a 
type for a value the property's class does not hold), the
+ * interface of a registered type the property's class implements ({@code 
serializable}), or the type a converter converts when the property's
+ * class is not one it accepts.</p>
  *
  * @since 9.0
  */
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesConverterClassSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesConverterClassSpec.groovy
new file mode 100644
index 0000000000..b60528dae5
--- /dev/null
+++ 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesConverterClassSpec.groovy
@@ -0,0 +1,175 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package grails.gorm.tests.generated
+
+import java.sql.Connection
+import java.sql.ResultSet
+import java.sql.ResultSetMetaData
+import java.util.concurrent.atomic.AtomicInteger
+
+import grails.gorm.annotation.Entity
+import org.hibernate.mapping.Table
+import spock.lang.AutoCleanup
+import spock.lang.Specification
+import spock.lang.Unroll
+
+import org.grails.orm.hibernate.HibernateDatastore
+
+/**
+ * A {@code type} that names an {@code AttributeConverter} class, such as 
{@code org.hibernate.type.YesNoConverter}. The domain binder
+ * converts the property with it, whatever the class of the property is, and 
also when the property is a {@code hasMany} stored in one
+ * column. The generated mode boots with the same schema and converts the same 
way.
+ */
+class GeneratedDomainClassesConverterClassSpec extends Specification {
+
+    static final AtomicInteger BOOTS = new AtomicInteger()
+
+    @AutoCleanup
+    HibernateDatastore datastore
+
+    private HibernateDatastore boot(List<Class> group, boolean generated) {
+        datastore?.close()
+        datastore = new HibernateDatastore([
+                'dataSource.url'                  : 
"jdbc:h2:mem:tns${BOOTS.incrementAndGet()};LOCK_TIMEOUT=10000".toString(),
+                'dataSource.dbCreate'             : 'create-drop',
+                'hibernate.generatedDomainClasses': generated,
+        ], group as Class[])
+        return datastore
+    }
+
+    /** The tables of the boot model as plain data: columns with SQL type and 
nullability, indexes, unique keys. */
+    private Map<String, Map> schema(HibernateDatastore booted) {
+        Map<String, Map> result = new TreeMap<String, Map>()
+        for (Table table : booted.metadata.collectTableMappings()) {
+            if (table.physicalTable) {
+                result[table.name] = [
+                        columns   : table.columns.collectEntries { 
org.hibernate.mapping.Column column ->
+                            boolean nullable = column.nullable && 
!(table.primaryKey != null && 
table.primaryKey.columns*.name.contains(column.name))
+                            [(column.name): 
"${column.getSqlType(booted.metadata)}${nullable ? '' : ' not 
null'}${column.unique ? ' unique' : ''}".toString()]
+                        },
+                        primaryKey: table.primaryKey?.columns*.name?.sort(),
+                        indexes   : table.indexes.values().collectEntries { 
[(it.name): it.columns*.name] },
+                        uniqueKeys: table.uniqueKeys.values().collect { 
it.columns*.name.sort() }.sort { it.toString() },
+                ]
+            }
+        }
+        return result
+    }
+
+    /** The rows of a table as stored, binary values as lists of bytes. */
+    private List<List> rows(String sql) {
+        return 
datastore.connectionSources.defaultConnectionSource.dataSource.connection.withCloseable
 { Connection connection ->
+            ResultSet result = connection.createStatement().executeQuery(sql)
+            ResultSetMetaData meta = result.metaData
+            List<List> found = []
+            while (result.next()) {
+                found << (1..meta.columnCount).collect { int i ->
+                    Object value = result.getObject(i)
+                    value instanceof byte[] ? ((byte[]) value).toList() : value
+                }
+            }
+            found
+        }
+    }
+
+    /** What a property does when it is saved, read back by a new session and 
stored: the value, or why it could not be read. */
+    private Map roundTrip(HibernateDatastore booted, Class type, Map<String, 
Object> values, String property, String select) {
+        Long id = type.withTransaction { 
type.newInstance(values).save(failOnError: true, flush: true).id }
+        Map observed = [stored: rows(select)]
+        try {
+            Object value = type.withNewSession { type.get(id)."${property}" }
+            observed.reloaded = value instanceof byte[] ? ((byte[]) 
value).toList() : value
+        } catch (Throwable e) {
+            Throwable root = e
+            while (root.cause != null && root.cause != root) {
+                root = root.cause
+            }
+            observed.reloaded = "cannot be read: 
${root.class.simpleName}".toString()
+        }
+        return observed
+    }
+
+    @Unroll
+    void "#label has the column type the domain binder gives it"() {
+        when:
+        Map<String, Map> binder = schema(boot(group, false))
+        Map<String, Map> generated = schema(boot(group, true))
+
+        then:
+        generated == binder
+        generated[table].columns[column] == type
+
+        where:
+        label                                                | group           
       | table                 | column          | type
+        'a boolean converted by an attribute converter'      | 
[TnConvertedBoolean]   | 'tn_converted_boolean' | 'flag'         | 'char(1)'
+        'a string typed with an attribute converter'         | 
[TnConvertedString]    | 'tn_converted_string' | 'data'          | 'char(1)'
+        'a set typed with an attribute converter'            | 
[TnConvertedSet]       | 'tn_converted_set'    | 'categories'    | 'char(1)'
+    }
+
+    void "a boolean converted by an attribute converter is stored as the 
converter says and read back"() {
+        when:
+        Map binder = roundTrip(boot([TnConvertedBoolean], false), 
TnConvertedBoolean, [flag: true], 'flag', 'select flag from 
tn_converted_boolean')
+        Map generated = roundTrip(boot([TnConvertedBoolean], true), 
TnConvertedBoolean, [flag: true], 'flag', 'select flag from 
tn_converted_boolean')
+
+        then:
+        generated == binder
+        generated == [stored: [['Y']], reloaded: true]
+
+        and: "a query on the property converts its parameter"
+        TnConvertedBoolean.withNewSession { 
TnConvertedBoolean.findAllByFlag(true)*.flag } == [true]
+        TnConvertedBoolean.withNewSession { 
TnConvertedBoolean.findAllByFlag(false) } == []
+    }
+
+    void "an attribute converter on a property of a class it does not convert 
is accepted by both bindings and fails the same way when used"() {
+        when:
+        Map<Boolean, String> outcome = [false, true].collectEntries { boolean 
generated ->
+            boot([TnConvertedString], generated)
+            String result
+            try {
+                TnConvertedString.withTransaction { new 
TnConvertedString(data: 'Y').save(failOnError: true, flush: true) }
+                result = 'saved'
+            } catch (Throwable e) {
+                result = 'failed'
+            }
+            [(generated): result]
+        }
+
+        then:
+        outcome[true] == outcome[false]
+    }
+}
+
+@Entity
+class TnConvertedBoolean {
+    Boolean flag
+    static mapping = { flag type: 'org.hibernate.type.YesNoConverter' }
+}
+
+@Entity
+class TnConvertedString {
+    String data
+    static mapping = { data type: 'org.hibernate.type.YesNoConverter' }
+}
+
+@Entity
+class TnConvertedSet {
+    Set<String> categories
+    static hasMany = [categories: String]
+    static mapping = { categories type: 'org.hibernate.type.YesNoConverter' }
+}
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy
index 4b49a3f8fe..cd44f3bb23 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy
@@ -83,7 +83,6 @@ class GeneratedDomainClassesDdlDifferentialSpec extends 
Specification {
     private static final List<String> REFUSALS = [
             'neither side of the many-to-many owns it',
             'is registered for the Java type',
-            'names a class that is not a UserType',
             'declares a natural id but is a subclass',
             'which is HibernateEmbeddedProperty',
             'which is not a persistent property of the entity',
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorDifferentialSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorDifferentialSpec.groovy
index 8e680c0873..dcf4159d8e 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorDifferentialSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorDifferentialSpec.groovy
@@ -1098,7 +1098,7 @@ class GrailsDomainGeneratorDifferentialSpec extends 
HibernateGormDatastoreSpec {
     /**
      * The explicit type the generator states must be the one the binder put 
on the bound value: the same
      * {@code UserType} class and parameters, or the same JDBC type for a 
registered type name; with no explicit type the
-     * binder's type name is the property's own class and it has no parameters.
+     * binder's type name is the property's own class and it has no 
parameters. A converter named by its class carries no JDBC type.
      */
     private List<String> compareType(
             String where, HibernatePersistentProperty property, 
GrailsDomainGenerator generator,
@@ -1130,7 +1130,8 @@ class GrailsDomainGeneratorDifferentialSpec extends 
HibernateGormDatastoreSpec {
             explicitTypes["registered ${value.typeName} 
(converter)".toString()]++
             BasicValue.Resolution<?> resolution = value.resolve()
             if (value.typeName != property.getTypeName(type) || 
resolution.valueConverter?.getClass() != facets.converter() ||
-                    resolution.jdbcType.defaultSqlTypeCode != 
facets.jdbcTypeCode()) {
+                    (facets.jdbcTypeCode() != null && 
resolution.jdbcType.defaultSqlTypeCode != facets.jdbcTypeCode())) {
+                // a converter named by its class states no JDBC type: the one 
the converter alone resolves to is the binder's too
                 found << "${where} converter: 
generator=${facets.converter()}/${facets.jdbcTypeCode()} 
binder=${resolution.valueConverter?.getClass()}/${resolution.jdbcType.defaultSqlTypeCode}
 (type ${value.typeName})".toString()
             }
         } else {
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorSpec.groovy
index 4003c38787..251d0801ab 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GrailsDomainGeneratorSpec.groovy
@@ -168,7 +168,7 @@ class GrailsDomainGeneratorSpec extends 
HibernateGormDatastoreSpec {
                 GenOmParent, GenOmChild, GenOmListed, GenOmOrdered, 
GenOmOrphan, GenOmFetched, GenOmTag, GenOmStep, GenOmKept, GenOmSortedOwner, 
GenOmMapOwner, GenMapBidiOwner, GenMapBidiChild, GenEmbAssocOwner,
                 GenMmStudent, GenMmCourse, GenMmPerson, GenParamsOnly, 
GenDecimal, GenUnversioned, GenUnversionedRoot, GenUnversionedChild, 
GenConverted, GenValueTyped,
                 GenCollEmbeddedHolder, GenCollEmbeddedSibling, 
GenCollEmbeddedItem, GenCollEmbeddedEntityHolder, GenMapM2mLeft, GenMapM2mRight,
-                GenSerialized, GenTypeParams)
+                GenSerialized, GenTypeParams, GenConverterClass)
     }
 
     List<StandardServiceRegistry> registries = []
@@ -408,6 +408,19 @@ class GrailsDomainGeneratorSpec extends 
HibernateGormDatastoreSpec {
         params.getDeclaredField('amount').getAnnotation(JdbcTypeCode).value() 
== java.sql.Types.INTEGER
     }
 
+    void "a type that names an attribute converter class becomes @Convert, on 
a field of the type the converter converts"() {
+        when:
+        Class<?> converted = generate(GenConverterClass)
+
+        then:
+        converted.getDeclaredField('flag').getAnnotation(Convert).converter() 
== YesNoConverter
+        converted.getDeclaredField('flag').type == Boolean
+        !converted.getDeclaredField('flag').isAnnotationPresent(Type)
+        !converted.getDeclaredField('flag').isAnnotationPresent(JdbcTypeCode)
+        converted.getDeclaredField('data').getAnnotation(Convert).converter() 
== YesNoConverter
+        converted.getDeclaredField('data').type == Boolean
+    }
+
     void "Hibernate's own annotation binder resolves a converted type like the 
domain binder"() {
         given:
         Map<GrailsHibernatePersistentEntity, Class<?>> classes = 
generateGroup(GenConverted)
@@ -2846,6 +2859,18 @@ class GenTypeParams {
     }
 }
 
+@Entity
+class GenConverterClass {
+
+    Boolean flag
+    String data
+
+    static mapping = {
+        flag type: 'org.hibernate.type.YesNoConverter'
+        data type: 'org.hibernate.type.YesNoConverter'
+    }
+}
+
 class GenUpperType implements UserType<String>, ParameterizedType {
 
     @Override
diff --git 
a/grails-data-hibernate7/docs/src/docs/asciidoc/advancedGORMFeatures/nativeDomainBinding.adoc
 
b/grails-data-hibernate7/docs/src/docs/asciidoc/advancedGORMFeatures/nativeDomainBinding.adoc
index 14b6b71b23..7c1478fdae 100644
--- 
a/grails-data-hibernate7/docs/src/docs/asciidoc/advancedGORMFeatures/nativeDomainBinding.adoc
+++ 
b/grails-data-hibernate7/docs/src/docs/asciidoc/advancedGORMFeatures/nativeDomainBinding.adoc
@@ -64,6 +64,7 @@ For the domain classes in GORM's own test suites, both 
bindings produce the same
 * A `Map` on a many-to-many (`Map<String, Book> books` with a `Set` or another 
`Map` on the other side) writes its own join table, with the key column of the 
map as part of the primary key, as with classic binding. A `Set` on the other 
side reads that table and does not write it, and two maps are two separate 
tables: rows stored through one map are not visible through the other, in both 
bindings.
 * `type: 'serializable'` on a property that is not a collection (a `String`, a 
`byte[]` or any `Serializable`) is a binary column holding the Java 
serialization of the value, as with classic binding.
 * `params` on a registered type name such as `type: 'string'` are ignored, as 
with classic binding. They reach the type when it is a `UserType` that 
implements `ParameterizedType`.
+* A `type` that names an `AttributeConverter` class, for example `type: 
'org.hibernate.type.YesNoConverter'`, converts the property with it, on a 
single property as well as on a `hasMany` stored in one column, as with classic 
binding.
 * Identifier generators, inheritance strategies (single table, joined and 
table-per-concrete-class), discriminators, natural ids, optimistic locking, 
lazy and eager fetching, cascades, sorting, batch size and `cache` usage are 
mapped as with classic binding.
 
 [[nativeDomainBinding-refused]]
@@ -103,10 +104,6 @@ Nothing is ignored silently. A mapping that boots is bound 
the way it is written
 | `Type [string] of property [...] is registered for the Java type 
[java.lang.String], not the property's [java.lang.Integer] ...`
 | Use a `UserType` class, or a type name registered for the property's own 
type.
 
-| An `AttributeConverter` class named as the `type`, for example `type: 
'org.hibernate.type.YesNoConverter'`.
-| `Type [...] of property [...] names a class that is not a UserType (an 
AttributeConverter, for example) ...`
-| Use the registered names `yes_no`, `true_false` or `numeric_boolean`, or 
write a `UserType`.
-
 | `insertable: false` or `updatable: false` on a property that has no column 
of its own: a collection, an embedded object, or the inverse side of a 
one-to-one.
 | `... insertable: false or updatable: false is mapped on a property that has 
no column of its own ...`
 | Remove the option. Classic binding ignores it on such a property. On a 
property with a column, both bindings honor it.
@@ -163,7 +160,7 @@ Some bugs of classic binding are not copied by native 
binding. Native binding do
 [[nativeDomainBinding-schema]]
 === Differences in the Schema
 
-The schema of 694 groups of related domain classes was created with both 
bindings on H2 and compared: tables, columns with type, nullability, default, 
length, precision and scale, primary keys with their column order, foreign 
keys, unique keys, indexes, check constraints and sequences. Apart from the 6 
groups that native binding refuses, these are the differences. Other databases 
are not covered by this comparison, so verify against your own database as 
described below.
+The schema of 700 groups of related domain classes was created with both 
bindings on H2 and compared: tables, columns with type, nullability, default, 
length, precision and scale, primary keys with their column order, foreign 
keys, unique keys, indexes, check constraints and sequences. Apart from the 4 
groups that native binding refuses, these are the differences. Other databases 
are not covered by this comparison, so verify against your own database as 
described below.
 
 [cols="2,3,3", options="header"]
 |===

Reply via email to