|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Problem with simple inheritance and drop-downsHi, Trailsers:
I have a simple inheritance situation where I have a common base class, and several classes which inherit from it - class-per-table. There is no table for the common base class. I am using @MappedSuperclass and no @Entity in my base class. There are many common properties which are all defined in the common base class, including annotations. In general it seems to be working except for one presentation issue with one type of property, when it is defined in the base class: WORKING: text boxes, dates, M-M relationships, 1-M relationships: NOT WORKING: M-1 relationships which manifest as a drop down in the presentation. The visible behavior is that there is no selected="" attribute in the rendering of the drop-down, so the default is shown. Yet I know that the query hibernate runs returns lots of varied and valid data for this property. This was working fine pre-inheritance, then broken when I implemented the inheritance and moved the common properties into the base class. Any ideas? Thanks, Mark |
|
|
Re: Problem with simple inheritance and drop-downsHi Mark
I have no idea. Could you send me some example to reproduce the error? I promise to take a look. Alejandro. On 10/19/07, Mark Dzmura <mark.dzmura@...> wrote: > Hi, Trailsers: > > I have a simple inheritance situation where I have a common base class, and > several classes which inherit from it - class-per-table. > There is no table for the common base class. I am using @MappedSuperclass > and no @Entity in my base class. > > There are many common properties which are all defined in the common base > class, including annotations. > > In general it seems to be working except for one presentation issue with one > type of property, when it is > defined in the base class: > > WORKING: text boxes, dates, M-M relationships, 1-M relationships: > > NOT WORKING: M-1 relationships which manifest as a drop down in the > presentation. The visible > behavior is that there is no selected="" attribute in the rendering of the > drop-down, so the default is shown. > Yet I know that the query hibernate runs returns lots of varied and valid > data for this property. > > This was working fine pre-inheritance, then broken when I implemented the > inheritance and moved > the common properties into the base class. > > Any ideas? > > Thanks, > Mark > > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Problem with simple inheritance and drop-downsAlejandro:
Thanks. I'll make up a simple example this weekend and see if it has the same behavior. If it does, I'll email it. -Mark On 10/19/07,
Alejandro Scandroli <alejandroscandroli@...> wrote: Hi Mark |
|
|
RE: Problem with simple inheritance and drop-downs
Have you referred to roster demo.
That demo implements inheritence with Person as base class. There are several derivatives. I encountered issues with both inheritence strategies but not like you described. Thats not to say your issue is false. Here is my Person.JAVA (as you can see commented out inheritence strategies swapped from time to time) @ Entity@ RemoveRequiresRole( { "ROLE_ADMIN", "ROLE_MANAGER" })@ UpdateRequiresRole( { "ROLE_ADMIN", "ROLE_MANAGER" })@ ViewRequiresRole( { "ROLE_ADMIN", "ROLE_MANAGER", "ROLE_USER" })@ ValidateUniqueness(property = "emailAddress")@ Inheritance(strategy = InheritanceType.SINGLE_TABLE)// @Inheritance(strategy = InheritanceType.JOINED) // @MappedSuperclass @ClassDescriptor(hidden = true)public class Person implements UserDetails, Cloneable, Serializable If I were to notice PropertySelection issues in roster they would have been reported but I have not. I would recommend reviewing roster and get back to us on this. Best regards Ken in nashua > Date: Sat, 20 Oct 2007 00:55:51 +0200 > From: alejandroscandroli@... > To: users@... > Subject: Re: [trails-users] Problem with simple inheritance and drop-downs > > Hi Mark > > I have no idea. > Could you send me some example to reproduce the error? > I promise to take a look. > > Alejandro. > > On 10/19/07, Mark Dzmura <mark.dzmura@...> wrote: > > Hi, Trailsers: > > > > I have a simple inheritance situation where I have a common base class, and > > several classes which inherit from it - class-per-table. > > There is no table for the common base class. I am using @MappedSuperclass > > and no @Entity in my base class. > > > > There are many common properties which are all defined in the common base > > class, including annotations. > > > > In general it seems to be working except for one presentation issue with one > > type of property, when it is > > defined in the base class: > > > > WORKING: text boxes, dates, M-M relationships, 1-M relationships: > > > > NOT WORKING: M-1 relationships which manifest as a drop down in the > > presentation. The visible > > behavior is that there is no selected="" attribute in the rendering of the > > drop-down, so the default is shown. > > Yet I know that the query hibernate runs returns lots of varied and valid > > data for this property. > > > > This was working fine pre-inheritance, then broken when I implemented the > > inheritance and moved > > the common properties into the base class. > > > > Any ideas? > > > > Thanks, > > Mark > > > > > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > Help yourself to FREE treats served up daily at the Messenger Café. Stop by today! Best regards
Ken in nashua |
|
|
Re: Problem with simple inheritance and drop-downsThanks for the suggestions - it ended up being pretty simple. I made a simple two-class example and could not duplicate my problem. I did a clean rebuild, dropped my tables, had hibernate rebuild them, re-populated, and the problem was gone. I think a stale constraint might have been the problem... but I'm a little puzzled why this fixed the problem, because I don't believe any constraints changed when I added inheritance. I must have missed something. Thanks again, Mark On 10/22/07, Ken nashua <nhhockeyplayer@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |