Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Mapping inherited id attribute
Mapping inherited id attribute [message #385404] Wed, 28 January 2009 00:00 Go to next message
David J Rericha is currently offline David J RerichaFriend
Messages: 13
Registered: July 2009
Junior Member
Dear fellow members,

I would like to inherit an id attribute from a mapped superclass using a
Table sequence generator. However, I would like the column names and the
sequence names to be different for the subclasses. I found this question
asked here:
http://dev.eclipse.org/newslists/news.eclipse.rt.eclipselink /msg00180.html,
but I could not figure it out. If a DescriptorCustomizer is the way to do
this, could you provide an example? I cannot find anything explicit in
the documentation.

Thanks,


David
Re: Mapping inherited id attribute [message #385408 is a reply to message #385404] Wed, 28 January 2009 13:51 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

JPA does not allow you to override a generator in a subclass.

To use a DescriptorCustomizer it would do something like:

public class MyCustomizer implements DescriptorCustomizer {
public void customize(ClassDescriptor descriptor) {
descriptor.setSequenceName("SUB_SEQ");
}
}

Where SUB_SEQ was another sequence generator that you defined.

For a list of ClassDescriptor API see,

<a
href=" http://wiki.eclipse.org/Configuring_a_Relational_Descriptor_ (ELUG)#How_to_Configure_Sequencing_at_the_Descriptor_Level_U sing_Java ">User
Guide</a>

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Previous Topic:Caching or Isolations-Level Problem?
Next Topic:JDK 1.4?
Goto Forum:
  


Current Time: Thu Apr 25 23:52:04 GMT 2024

Powered by FUDForum. Page generated in 0.03500 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top