OpenJPA
  1. OpenJPA
  2. OPENJPA-1564

How to Utilizing the variable define in non-entity base class, in the entity sub class.

    Details

    • Type: Question Question
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I have BaseFacDto class with defined properties. I have sub-class FacDto (entity) extending BaseFacDto.

      public abstract class BaseFacDto

      { @Column(name="FAC_NAME") public String facName; --- }

      @Entity
      @Table(name="FAC")
      public class FacDto extends BaseFacDto implements Serializable {
      public FacDto(){}
      @Id @Column(name="FAC_ID", nullable = false)
      private String facId;
      @Column(name="FAC_ADDRESS")
      private String facAddress;
      @Column(name="LABID")
      }

      Questions:
      1. When the query fac = clep.find(FacDto.class, facId); I don't see FAC_NAME in the logged SQL generated. Since Base class has this variable, so sub-class also get it by inheritance. Please verify. I have define it like this in base class
      @Column(name="FAC_NAME")
      private String facName;

      2. I also tried this thing. I created the variable in the sub-class without getter-setter. Now I see the FAC_NAME in the sql log. But the issue now is when I execute getter methods ( inherited from base class). the value is always null.
      @Column(name="FAC_NAME")
      private String facName;

      3. How OpenJPA different from JPA. I see that all OpenJpa sample uses the javax.persistance.jar (JPA jar). I am little confused over this. Please clarify
      http://openjpa.apache.org/quick-start.html

      Please help.
      Thanks in advance
      Rajeev

        Activity

        Rajeev Chaudhary created issue -
        Rajeev Chaudhary made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Rajeev Chaudhary
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development