Trails
  1. Trails
  2. TRAILS-81

regression:OneToOne decoration faulty...HARD OneToOne associations broken

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.0
    • Component/s: trails-hibernate
    • Labels:
      None
    • Environment:
      All
    • Number of attachments :
      1

      Description

      AssociationSelect does not support soft associations anymore

      Previous revisions of trails-1.1-SNAPSHOT supported a version of HibernateDescriptorDecorator that accomodated HARD and SOFT OneToOne associations.

      Hard meaning the OneToOne property editor would render.
      Soft meaning the simple AssociationSelect property editor would render.

      Currently, recent modifications have regressed to just the former. Latter logic is no longer working.

      It is all based on the parsing of the mappedBy annotation field and the determination of whether to instantiate ObjectReferenceDescriptor or OwningObjectReferenceDescriptor.

      Former logic operated as follows:

      If mappedBy = "" then instantiate ObjectReferenceDescriptor.
      If mappedBy= "something" then drill into class reflection and find the owner and it's associated property and instantiate OwningObjectReferenceDescriptor using those attributes retrieved from class reflection.

      The code for this was pain staking and valuable.

      It would be nice to see it working asap.

        Activity

        Hide
        Ken in nashua added a comment -

        STATUS...

        I had dropped the ball on this since it's creation.

        The past 4 weeks have been hampered with ognl breakages and running the trails app has been close to impossible.

        Couple that with pre-emptions and there is not alot I have been able to reliably do with regard to operating this functionality (that being the OneToOne editor).

        I would like to resume and fix this unless someone has a better in to the code than I do.

        This bug basically requires that the OneToOne editor be re-looked-at and resolved since it was breaking after the tapestry-4.1.2 merge.

        Show
        Ken in nashua added a comment - STATUS... I had dropped the ball on this since it's creation. The past 4 weeks have been hampered with ognl breakages and running the trails app has been close to impossible. Couple that with pre-emptions and there is not alot I have been able to reliably do with regard to operating this functionality (that being the OneToOne editor). I would like to resume and fix this unless someone has a better in to the code than I do. This bug basically requires that the OneToOne editor be re-looked-at and resolved since it was breaking after the tapestry-4.1.2 merge.
        Hide
        Ken in nashua added a comment -

        Ok, the new behavior of this editor currently is the following asof current checkins:

        Click NEW on the OneToOne property (ie. and nothing happens.

        • no editor comes up
        • editor page blips/blinks
        • no behavior whatsoever
        Show
        Ken in nashua added a comment - Ok, the new behavior of this editor currently is the following asof current checkins: Click NEW on the OneToOne property (ie. and nothing happens. no editor comes up editor page blips/blinks no behavior whatsoever
        Hide
        Ken in nashua added a comment -

        Needed to clarify the title to this...

        Although soft associations by AssociationSelect may have been mentioned, impacted and subsequently resolved throughout the framework, the main initiative behind this JIRA was the impact to hard associations implemented by the OneToOne property editor. They got broken post T-4.1 merge.

        The semantics surrounding the descriptor decorator are under review.

        The main problem is that the case logic currently is resulting in the wrong desciptor being allocated at bootstrap.

        Show
        Ken in nashua added a comment - Needed to clarify the title to this... Although soft associations by AssociationSelect may have been mentioned, impacted and subsequently resolved throughout the framework, the main initiative behind this JIRA was the impact to hard associations implemented by the OneToOne property editor. They got broken post T-4.1 merge. The semantics surrounding the descriptor decorator are under review. The main problem is that the case logic currently is resulting in the wrong desciptor being allocated at bootstrap.
        Hide
        Ken in nashua added a comment -

        This could use some hands on testing...

        If you see anything just give me a holler.

        Show
        Ken in nashua added a comment - This could use some hands on testing... If you see anything just give me a holler.
        Hide
        Ken in nashua added a comment -

        BTW:

        Originally I designed this to operate the @OneToOne attribute mappedBy which gave us a handle to the inverse that the developer codes to the class.

        This design has changed and I decided to go with the extra annotation @HardOneToOne for detection/isolation of logic. I would have preferred to instrument @OneToOne with Identity but was discouraged from that.

        For your pojos...
        To setup the hard owner we use two annotations
        @OneToOne
        @HardOneToOne(identity = Identity.OWNER)
        To setup the hard association we use two annotations
        @OneToOne
        @HardOneToOne(identity = Identity.ASSOCIATION)

        Here is the use model...

        OWNER-<>-----ASSOCIATION

        We will use what roster demo uses to explain...

        Organization--<>-------Director

        This says only one director can be anchored to any Organization.

        Here is the usage...

        Organization.JAVA
        @OneToOne(cascade = CascadeType.REFRESH)
        @HardOneToOne(identity = Identity.OWNER)
        @JoinTable(name = "join_table_Organization_Director", joinColumns = @JoinColumn(name = "director_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns =

        { @JoinColumn(name = "organization_fk", insertable = true, updatable = true, nullable = true) }

        )
        public Director getDirector()

        { return director; }

        Director.JAVA
        @OneToOne
        @HardOneToOne(identity = Identity.ASSOCIATION)
        @JoinTable(name = "join_table_Organization_Director", joinColumns = @JoinColumn(name = "organization_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns =

        { @JoinColumn(name = "director_fk", insertable = true, updatable = true, nullable = true) }

        )
        public Organization getOrganization()

        { return organization; }
        Show
        Ken in nashua added a comment - BTW: Originally I designed this to operate the @OneToOne attribute mappedBy which gave us a handle to the inverse that the developer codes to the class. This design has changed and I decided to go with the extra annotation @HardOneToOne for detection/isolation of logic. I would have preferred to instrument @OneToOne with Identity but was discouraged from that. For your pojos... To setup the hard owner we use two annotations @OneToOne @HardOneToOne(identity = Identity.OWNER) To setup the hard association we use two annotations @OneToOne @HardOneToOne(identity = Identity.ASSOCIATION) Here is the use model... OWNER- <> -----ASSOCIATION We will use what roster demo uses to explain... Organization-- <> -------Director This says only one director can be anchored to any Organization. Here is the usage... Organization.JAVA @OneToOne(cascade = CascadeType.REFRESH) @HardOneToOne(identity = Identity.OWNER) @JoinTable(name = "join_table_Organization_Director", joinColumns = @JoinColumn(name = "director_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns = { @JoinColumn(name = "organization_fk", insertable = true, updatable = true, nullable = true) } ) public Director getDirector() { return director; } Director.JAVA @OneToOne @HardOneToOne(identity = Identity.ASSOCIATION) @JoinTable(name = "join_table_Organization_Director", joinColumns = @JoinColumn(name = "organization_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns = { @JoinColumn(name = "director_fk", insertable = true, updatable = true, nullable = true) } ) public Organization getOrganization() { return organization; }

          People

          • Assignee:
            Ken in nashua
            Reporter:
            Ken in nashua
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: