XDoclet 2 Plugins
  1. XDoclet 2 Plugins
  2. XDP-88

When using hibernate.component, it would really useful if column names for the component's properties are specified in the parent class and not in the component class

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.4
    • Component/s: hibernate
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This is my situation:

      I have a class A (this is my component class) that can be part of different entity classes (classes that are persisted by hibernate). Classes B,C, and D (which are my entity classes) can contain one or more instances of class A as a property. Class A, being a component class, is persisted along with its parent class in the same table. The issue I have is that the column names used in the parent classes for the component properties (class A's properties) are different... they are not simply and cannot be the same. For instance, let's say class A has 3 properties. Then, class B might use aaa, bbb, ccc as the column names to persist the three properties of class A while class C might use zzz, yyy, xxx as the column names to persist the properties of class A. So, speciying the column names in class A does not work for me. Note that the prefix parameter of the hibernate.component tag does not help in this case. I would need a way to define the column names for the properties of class A in the parent class along with the hibernate.component tag.

      Is this a change that could be made to the hibernate plugin? If so, how long would it take?

        Activity

        Hide
        Konstantin Pribluda added a comment -

        Any idea how we could achieve this?

        The only way I see would to add some kind "context" parameter to property tags, and also
        context to @hibernate.component to select proper one...

        Show
        Konstantin Pribluda added a comment - Any idea how we could achieve this? The only way I see would to add some kind "context" parameter to property tags, and also context to @hibernate.component to select proper one...
        Hide
        Michael Plöd added a comment -

        I would consider this feature to be very important. In a current projet this feature would save us a lot of time.

        Show
        Michael Plöd added a comment - I would consider this feature to be very important. In a current projet this feature would save us a lot of time.
        Hide
        Konstantin Pribluda added a comment -

        As you may imagine this would be a big amount of work.
        (to fix all the tjelly mplates & some coding )

        Dare to create a patch?

        Show
        Konstantin Pribluda added a comment - As you may imagine this would be a big amount of work. (to fix all the tjelly mplates & some coding ) Dare to create a patch?
        Hide
        Michael Plöd added a comment -

        I'm not too familiar with xdoclet plugin development but I will have a try....

        Regarding your last post with the context parameter:
        Did you think of something like this:
        ......
        @hibernate.component class="MyComponent" property_context="myComp"
        @hibernate.property name="propA" property_context="myComp" column="prop_a"
        @hibernate.property name="propB" property_context="myComp" column="prop_b"
        private MyComponent comp;
        .....

        Show
        Michael Plöd added a comment - I'm not too familiar with xdoclet plugin development but I will have a try.... Regarding your last post with the context parameter: Did you think of something like this: ...... @hibernate.component class="MyComponent" property_context="myComp" @hibernate.property name="propA" property_context="myComp" column="prop_a" @hibernate.property name="propB" property_context="myComp" column="prop_b" private MyComponent comp; .....
        Hide
        Konstantin Pribluda added a comment -

        This would require a lot of changes in all the jelly files.
        ( property is a core concept )

        Normally you map @hibernate.component ion this getter,
        and then normal property tags on component itself - then
        all the property generating templates shall be extendet to look
        for multiple tags and select one of them based on which context
        we are

        I assume subclassing of component classes is not an option...
        Maybe there is something similar to entity for components?

        regards,

        Show
        Konstantin Pribluda added a comment - This would require a lot of changes in all the jelly files. ( property is a core concept ) Normally you map @hibernate.component ion this getter, and then normal property tags on component itself - then all the property generating templates shall be extendet to look for multiple tags and select one of them based on which context we are I assume subclassing of component classes is not an option... Maybe there is something similar to entity for components? regards,
        Hide
        Konstantin Pribluda added a comment -

        BTW, there is "prefix" param for thwe component, as well as @hibernate.properties

        Maybe this is already enough for your puproses?

        http://xdoclet.codehaus.org/HibernateTags#HibernateTags-hibernate.component

        Show
        Konstantin Pribluda added a comment - BTW, there is "prefix" param for thwe component, as well as @hibernate.properties Maybe this is already enough for your puproses? http://xdoclet.codehaus.org/HibernateTags#HibernateTags-hibernate.component
        Hide
        Konstantin Pribluda added a comment -

        I close this because there is no concept how to do this, and apparent lack of interest from persons who raised it. This has been active for too long.

        Reopen if you know how to do this.

        Show
        Konstantin Pribluda added a comment - I close this because there is no concept how to do this, and apparent lack of interest from persons who raised it. This has been active for too long. Reopen if you know how to do this.

          People

          • Assignee:
            Konstantin Pribluda
            Reporter:
            Ricardo Olivieri
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: