|Re: [eclipselink-users] Customizing the column names of embeddables|
Don't use, mapping.getReferenceDescriptor() (this is internal and not available until after initialization) use, session.getDescriptor(LengthType.class); then in your mapping you can override each column value using the AggregateObjectMapping addFieldNameTranslation() method. Frank Schwarz wrote: > > Thank you for your response. I tried the session-customizer and found that > with the post-login-event the getReferenceDescriptor()-method begins > returning a value other than null for the @embedded-field-mapping. Not too > late for EclipseLink to create the correct tables itself, but too late for > using the SchemaManager to create the DDL-scripts (see also Bug 227145 and > 243321). > > The actual question is somewhat more abstract: > 1.) Can one expect that the mapping is fully initialized when it is passed > into a descriptor-customizer? > From looking at the sources, the mapping of an embeddable is somewhat of a > corner case. Can the initialization process be reorderd? Is this a valid > RFE? (IHMO at least Bug 243321 is to depend on it.) > > 2.) If reordering is not feasible, would it be possible to get access to > the metadata-system from within the descriptor-customizer? Would this be a > valid RFE? (Perhaps a DescriptorCustomizer2-interface which also passes > into the customize()-method the current server-session as the second > argument?) > > I really appreciate your help, > Frank > > > > James Sutherland wrote: >> >> You need to get the descriptor for LengthType, so need the Session to do >> this. Perhaps use a SessionCustomizer instead of a DescriptorCustomizer. >> > > ----- http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland http://www.eclipse.org/eclipselink/ EclipseLink , http://www.oracle.com/technology/products/ias/toplink/ TopLink Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink , http://wiki.oracle.com/page/TopLink TopLink Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , http://www.nabble.com/EclipseLink-f26430.html EclipseLink Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence -- View this message in context: http://old.nabble.com/Customizing-the-column-names-of-embeddables-tp28276405p28447758.html Sent from the EclipseLink - Users mailing list archive at Nabble.com.
Back to the top