|DescriptorQueryManager+EntityManager [message #734288]
||Fri, 07 October 2011 07:38
| Neikius Mising name
Registered: April 2011
I have a bit of a special case here. I have to access all my data through stored procedures. I have read lots of stuff about DescriptorCustomizer and DescriptorQueryManager. But do they apply at all if I use EntityManager? I got the feeling they do not.
What I have so far:
* @NamedStoredProcedureQuery for one selectall procedure that returns a cursor (hopefully this part is ok, but got no errors)
* @Customizer points to the DescriptorCustomizer
* DescriptorCustomizer.customize function sets DescriptorQueryManager.setReadAllQuery() to an instance of namedQuery. I get the named query from @PersistenceContext injected EntityManager.
I am quite sure the named procedure never gets called (I put a where clause to the sql which returns a cursor, but I get the full table).
I am sure something is wrong, but the question here is - should this approach work at all? Am I basically wrong in some assumption and this cannot be made to work anyway or maybe this should work somehow and I am just erring somewhere.
Anyway, I gotta figure this out soon. Or I guess I will be calling sql the usual jdbc way as I did all my life... and writing my own caching and stuff.
Thanks for any information regarding this.
And btw, eclipselink sessions seem quite arcane to me. Also that workbench is strange and illogical. Guess some artifact from Toplink or what? I don't want to have too much xml configs anyway since I like the new way with annotations much better.