|
Re: Mapping entity property to stored functioncall - possible? [message #513036 is a reply to message #512463] |
Mon, 08 February 2010 16:01 |
|
There is no easy way to do this, so please log an enhancement request.
Some options include,
- Use an EclipseLink Converter to perform the same conversion in Java as the database function would.
- Define a database view that applies the function, and map to the view instead of the table.
- Use custom SQL to map to the object, using a DescriptorCustomizer you can override the readObject and readAll queries to use your own custom SQL.
- Use the function name inside the @Column name, this will work for simple one table SQL, but will fail for joins when aliases are used.
- Subclass DatabaseField to handle printing functions and set it into your mapping.
James : Wiki : Book : Blog : Twitter
|
|
|
|
Powered by
FUDForum. Page generated in 0.02178 seconds