Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » SessionCustomizer for column names
SessionCustomizer for column names [message #526479] Sun, 11 April 2010 13:06 Go to next message
Eclipse UserFriend
Hi,

How can a write a a SessionCustomizer, that translates property to column names like this? :

myProperty -> my_property

I'm interested in the SessionCustomizer code, not the actual translation method.

Thanks.
Re: SessionCustomizer for column names [message #526495 is a reply to message #526479] Sun, 11 April 2010 16:40 Go to previous messageGo to next message
Eclipse UserFriend
> I'm interested in the SessionCustomizer code, not the actual translation
> method.

This one way of binding a SessionCustomizer:

...
lOptions.put(PersistenceUnitProperties.SESSION_CUSTOMIZER, " nl.knowledgeplaza.profiler.engine.dao.jpa.KPSessionCustomize r ");
EntityManagerFactory lEntityManagerFactory = Persistence.createEntityManagerFactory("kpprofiler", lOptions);


public class KPSessionCustomizer implements org.eclipse.persistence.config.SessionCustomizer
{
@Override
public void customize(Session session) throws Exception
{
...
}
}
Re: SessionCustomizer for column names [message #526538 is a reply to message #526495] Mon, 12 April 2010 04:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Yes, i now that part.
What i don't know is how to get the property names, and do the actual translation.
Re: SessionCustomizer for column names [message #527044 is a reply to message #526479] Tue, 13 April 2010 15:37 Go to previous message
Eclipse UserFriend
The EclipseLink Session has a set of ClassDescriptors that have a set of DatabaseMappings. You can use the API for these classes to perform your customization.
Previous Topic:Open session in view
Next Topic:Log4j
Goto Forum:
  


Current Time: Sun Aug 31 14:56:58 EDT 2025

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

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

Back to the top