Errai
  1. Errai
  2. ERRAI-331

Errai JPA code generator should not use persistence.xml

    Details

    • Type: Feature Request Feature Request
    • Status: Closed Closed (View Workflow)
    • Priority: Minor Minor
    • Resolution: Done
    • Affects Version/s: 2.1.0.CR1
    • Fix Version/s: 2.2.0.CR1
    • Component/s: None
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      We currently require a persistence.xml in projects that use Errai JPA, because we get help from Hibernate at compile time, and we launch Hibernate in Java SE mode. JPA2 says providers running in the SE environment must provide an explicit persistence.xml, whereas providers running in the EE environment can omit persistence.xml and rely on classpath scanning.

      We already have the ability to scan for @Entity annotations, so we could construct a persistence.xml in cases when we can't find one.

        Activity

        Hide
        Jonathan Fuerth
        added a comment -

        While working on this, we decided that it's actually best to always ignore persistence.xml. This allows us to consider only the classes within the GWT-translatable packages. If we looked at persistence.xml, we would have to contend with entities that are only meant for the server side.

        So the fix that's committed here unconditionally bootstraps hibernate in "container" mode using an Errai-provided PersistenceUnitInfo implementation.

        Show
        Jonathan Fuerth
        added a comment - While working on this, we decided that it's actually best to always ignore persistence.xml. This allows us to consider only the classes within the GWT-translatable packages. If we looked at persistence.xml, we would have to contend with entities that are only meant for the server side. So the fix that's committed here unconditionally bootstraps hibernate in "container" mode using an Errai-provided PersistenceUnitInfo implementation.

          People

          • Assignee:
            Jonathan Fuerth
            Reporter:
            Jonathan Fuerth
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: