Hi Martin,
The table and column annotations are processed by
AnnotationPersistenceMappingParser.java and are then stored in the
MappingRepository. You can get the MappingRepository from
JDBCConfigurationImpl by calling getMappingRepositoryInstance().
>From there you can query the ClassMapping and get the table / column
information from there.
>From my head the code would look something like this :
ClassMapping mapping = (ClassMapping) ((JDBCConfiguration)conf)
.getMetaDataRepositoryInstance().getMetaData(entityClass,
getClass().getClassLoader(), true);
Table table = mapping.getTable().getName();
Column[] cols = mapping.getField(fieldName).getColumns();
Column col = cols[0];
>From there you have the results of applying the annotations and any xml
overrides.
Hope this helps,
-mike
On Mon, Oct 27, 2008 at 2:10 PM, Westhead, Martin (Martin) <
[EMAIL PROTECTED]> wrote:
> Hi,
>
>
> I am investigating implementing an LDAP data store for Open JPA. I have
> some basic storage and retrieval capabilities working in a proof of
> concept implementation. I was hoping to find some help accessing the
> persistence metadata, particularly things like the contents of @Table
> and @Column annotations. I was expecting this to be possible from the
> OpenJPAConfigurationImpl object but I haven't been able to see how to do
> it. Any hints and especially code snippets would be very gratefully
> received.
>
>
>
> Thanks,
>
>
>
> Martin
>
>