Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Customizing the column names of embeddables

DatabaseMapping#getReferenceDescriptor() is not internal. See for yourself:

    /**
     * PUBLIC:
     * Return the referenceDescriptor. This is a descriptor which is associated with
     * the reference class.
     */
    public ClassDescriptor getReferenceDescriptor() {
        return null;
    }

So is getReferenceDescriptor returning null in the DescriptorCustomizer the correct behavior (in terms of design)?

-- Frank,

James Sutherland wrote:
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.


View this message in context: Re: Customizing the column names of embeddables
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

Back to the top