Posting the Entity and the code that does the insert might help us with troubleshooting the issue.
Also, have you tried retrieving Entity1 using em.find(Entity1.class, id) to see if it can see the Entity1 instance?
To be able to decrypt the existing password, you can read the encrypted string from the database using JPA,
then decrypt it in the service layer.
The above solution will work although I have concerns about security.
The majority of applications/system consider it a security issue to send a customer's existing password by email.
What's stopping anyone from running this service to get customer's passwords?
Most would have a security question and answer filled up during registration.
When the customer forgets password, he supplies his username, security question/answer,
and a randomly generated password is emailed to him.
He will be forced to immediately change the password after he logins.
I don't think there's an encryption/decryption support in JPA.
You would have to do the encryption in the business/service layer as opposed to domain/data layer.
What we usually do is use an api (SAAJ, etc) to encrypt password when they are inserted.
When retrieving, the password supplied is encrypted and compared to the encrypted string in the database,
and the user is allowed to login.
This means there is really no need for decryption.
It may be that the server is caching. Try restarting your server and redeploying.
It shouldn't give you that same error if you've already fixed the JPQL.
Sorry, I haven't used OpenJPA or WAS7 to be able to help you with your question.
An error occurred while parsing the query filter 'SELECT o FROM LocState o where o.deleted = false and o.country.id = 88 AND UPPER(o.name) = "KARAMCHEDU"'.
Error message: org.apache.openjpa.kernel.jpql.TokenMgrError: Lexical error at line 1, column 93. Encountered: "\"" (34), after : ""
These two lines seem to suggest there's something wrong with the JPQL.
Shouldn't you be using single quotes instead of double quotes?
SELECT o FROM LocState o where o.deleted = false and o.country.id = 88 AND UPPER(o.name) = 'KARAMCHEDU'
I am using JPA on JSE.
I've added two records in the table, updated both records collectively,
and then retrieved both records to check they've been updated.
I've tried debugging, and the database is updated after the commit,
but the select doesn't return the newer versions.
If I get a new entity manager and use it to query, it passes.
Is there an explanation for this behavior
and is there a fix or a workaround without getting a new entity manager?
I'm following Mikalai Zaikin's SCBCD reviewer.
I'm trying to create an application-managed persistenace context in an EJB.
As far as I understood it, in EJB, for application-managed persistenace context,
the transaction-demarcation is still done by the container.
However, my test using Jboss is not being committed.
It stops at prePersist, and without any errors.
The test fails when it tries to retrieve the newly inserter
Could anybody give a clue why the transaction is not being committed?
Thanks!
When is the last day for the registration? Can people sign up up to th day before the first day of the exams?
By the way, I attempted to create some simple reviewer You can check out the first two topics at http://www.jroller.com/page/oliverchua/?anchor=scja_reviewer_fundamental_object_oriented1
I am trying to incorporate Jsptags' Pager taglib in my JSF application but I am stuck with this problem...
I'm using JSF1.1 RI...
The taglib has a pages tag, that sets up the clickable links to jump to certain pages. When I click on the link, the associated action is not called.
The <previous> link works, but the <pages> links doesn't. The only difference I can see is that the <pages> is called multiple times.
Initially, I had one form, but I kept getting the duplicate id error. Since I cannot append to the id attribute to make it unique, I decided to make each link a form...
I don't know if this is an issue but the <pages> param id is the same, although they belong to different forms. Can anyone verify if this is a bug or not?
Even if I leave out the id in the hope that the compiler generate an id for each link, the same problem happens.
I attempted to append a number to the id attribute to make it unique, like this id="pagesp#{pageNumber}", but it is not accepted by the compiler.