Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1549

Add unitName to @PersistenceContext

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 2.1.0.Final
    • 2.0.0.Final
    • Scaffold

      The scaffolding generates this kind of code in terms of persistence context (e.g. below is for JSF) :

      @PersistenceContext(type = PersistenceContextType.EXTENDED)
      

      Because it doesn't have any unitName it takes the default one, if there is only one persistence unit. It would be better to explicitelly add the unitName so the code still deploys if there are several persistence unit. As per FORGE-1513, the persistence unit name is the project name with -persistence-unit :

      @PersistenceContext(unitName = "myproject-persistence-unit", type = PersistenceContextType.EXTENDED)
      

            agoncal Antonio Goncalves (Inactive)
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: