Re: Null field not persisted for Dates

2011-05-11 Thread bp_maggie
I tested with this piece of code and it works: //modified is the instance client had changed Record modified = (Record) processClientRequest(); EntityManager em = emf.createEntityManager(); Record merged = (Record) em.merge(modified); //assume begin is a date and client set the date to null, updat

RE: query that uses String REPLACE function

2011-05-11 Thread Henno Vermeulen
Oh wow thank you for your elaborate help, I feel kind of bad for taking your time because I already fixed my problem using native queries. I'll record this help in case we need something similar in the future or when I need to adjust my code and native queries become less maintainable. Regards,

lazy fetch @Embedded

2011-05-11 Thread Henno Vermeulen
I am using fetch plans and I can lazy fetch individual attributes with @Basic(fetch = FetchType.LAZY), but now I have an entity with an embeddable which must sometimes be lazy fetched. Is it possible to lazy fetch an embeddable without having to annotate each of the embeddable's attributes with

RE: lazy fetch @Embedded

2011-05-11 Thread Henno Vermeulen
Oops sorry, I think I found a solution to my question. Support for removing an embeddable exists through the FetchPlan API itself (especially since https://issues.apache.org/jira/browse/OPENJPA-1486 is fixed?). I solved my problem by doing: FetchPlan fetchPlan = entityManager.ge

RE: lazy fetch @Embedded

2011-05-11 Thread Henno Vermeulen
Sorry, my problem is not yet solved. FetchPlan.removeField seems to only work for fields that were explicitly added and not for fields that are in the default fetchgroup. My guess is that the system cannot handle explicitly overriding individual eager fetched to become lazy. Is this true? The o

Re: Slice: extension of OpenJPA for distributed databases

2011-05-11 Thread lsp06
Pinaki, Thanks for the reply. My original post was a typo. the method as executed is actually public void setAddress(Addresses address) { this.address = address; } My distribution policy is consulted first when persisting the Person object. And then again when it persists the Addresses ob