Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Use Transformer in query
Use Transformer in query [message #484366] Mon, 07 September 2009 09:06 Go to next message
Martin JANDA is currently offline Martin JANDA
Messages: 1
Registered: July 2009
Junior Member
Please can you help me.

I have "Param" object with read+write transformer. And I want to map
"Columns" to "attributes" because I want to sort/select "Items" according
to Column "FREQ", "TYPE", ...

JPQL query: "select o from Items as o order by o.param.freq"
Thank you very much.
Martin

...
class Items {
...
@ReadTransformer(transformerClass = Param.class)
@WriteTransformers({
@WriteTransformer(transformerClass = ParamType.class, column =
@Column(name = "TYPE")),
@WriteTransformer(transformerClass = ParamDouble.class, column
= @Column(name = "FREQ", precision = 8, scale = 0)),
@WriteTransformer(transformerClass = ParamDouble.class, column
= @Column(name = "FREQ_LO_LIMIT", precision = 8, scale = 0)),
@WriteTransformer(transformerClass = ParamDouble.class, column
= @Column(name = "FREQ_HI_LIMIT", precision = 8, scale = 0))
})
private Param param = null;

...
}
Re: Use Transformer in query [message #484618 is a reply to message #484366] Tue, 08 September 2009 14:16 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Using transformation mappings in JPQL or Expression queries is not currently directly supported. Please log a bug for this.

You can define a user defined QueryKey using a DescriptorCustomizer to access the columns, but I think JPQL does not support QueryKey's either (please log a bug for that), but you can use Expression queries.

However, you may be better off trying to map the Param object as an Embeddable object in JPA. The you would be able to query it.


James : Wiki : Book : Blog : Twitter
Previous Topic:Equinox weaving configuration - Clasloading issue
Next Topic:Database Schema
Goto Forum:
  


Current Time: Sun Sep 21 06:18:15 GMT 2014

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

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