• Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.5.0.Final
    • None
    • EAP6 -> EAP7
    • None

      I went through the rules for Hibernate added as a part of WINDUPRULE-119 and I found these issues:

      • they have both hibernate5 and eap7 as target technologies, but they only have hibernate as a source technology, so using --source eap won't trigger the rules; I believe that a source technology of eap should be added (even though most of the rules, e.g. the ones for Configuration, are probably of little to no use in EE setting)
      • rules for methods Configuration.setImplicitNamingStrategy and Configuration.setPhysicalNamingStrategy are IIUC useless, because NamingStrategy was only split to two in Hibernate 5 (this is actually an inconsistency in Hibernate 5.0 migration guide, so I'm fine with leaving the rules in place)
      • the rule for Configuration.setNamingStrategy says "There is no direct replacement", which is not entirely true; as I said above (and it's also explained in https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc#naming-strategies), Hibernate 5 splits NamingStrategy into ImplicitNamingStrategy and PhysicalNamingStrategy, which are the replacement
      • the rule for org.hibernate.id.*Generator classes has a couple of issues:
        • it is imprecise in its wording: only TableGenerator and TableHiLoGenerator were removed (because they were deprecated in Hibernate 4.3); on the other hand, SequenceGenerator, SequenceIdentityGenerator and SequenceHiLoGenerator were supported in Hibernate 4.3 and they only got deprecated in Hibernate 5.0 – I think improving the message produced by the rule would be enough
        • also, the rule only looks for the *Generator classes being referenced in Java code, which is not how they are used; they can be referenced in a *.hbm.xml mapping file using <id><generator class="..."/></id> (I'm not aware of a possibility to refer to these classes in JPA or Hibernate-specific mapping annotations):
          • by a FQN: <generator class="org.hibernate.id.TableHiLoGenerator"/>
          • by a code name: <generator class="hilo"/> (TableGenerator: no code name, TableHiLoGenerator: hilo, SequenceGenerator: sequence, SequenceHiLoGenerator: seqhilo, SequenceIdentityGenerator: sequence-identity)
      • the migration hint for hibernate.transaction.factory_class sounds slightly misleading; it reads "Replace configuration transaction property hibernate.transaction.factory_class=org.hibernate.engine.transaction.spi.TransactionFactory with hibernate.transaction.coordinator_class=org.hibernate.resource.transaction.TransactionCoordinatorBuilder", but those class names are just names of SPI interfaces, not something people will actually have in their configuration files; can we use some kind of a placeholder mark there?
      • the Hibernate 5.0 migration guide describes a bunch of other changes that are subject to migration, yet there are no rules for them; I agree that the rules we have cover the most important changes, but is there possibly a way to provide a warning like "there were other changes between Hibernate 4.3 and 5.0 that are not covered by the existing rules; see https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc for more"?

              mnovotny@redhat.com Marek Novotny
              lthon@redhat.com Ladislav Thon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: