You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Prabu <pr...@gmail.com> on 2015/09/15 03:36:04 UTC

solve javax.persistence.EntityNotFoundException with JPA (not by using @NotFound in HIBERNATE)

HI Team

I am using JPA for my project and retrieving data from database.

ManyToOne relationship A (table1) to B (table2),if some element not present
in B i am getting

javax.persistence.EntityNotFoundException.

But,I want result with null value if element not present in table2 .don't
want error to throw in page

How solve javax.persistence.EntityNotFoundException with JPA (not by using
@NotFound in HIBERNATE)

Could you please help.

-- 
Thanks & Regards
 Prabu.N

Re: solve javax.persistence.EntityNotFoundException with JPA (not by using @NotFound in HIBERNATE)

Posted by Craig L Russell <cr...@oracle.com>.
Hi Prabu,

Can you post your schema, entities, mapping (annotations in the entities are sufficient), and application code that demonstrates the issue? Perhaps filing a JIRA with attachments is the easiest way to do this.

Thanks,

Craig

> On Sep 14, 2015, at 6:36 PM, Prabu <pr...@gmail.com> wrote:
> 
> HI Team
> 
> I am using JPA for my project and retrieving data from database.
> 
> ManyToOne relationship A (table1) to B (table2),if some element not present
> in B i am getting
> 
> javax.persistence.EntityNotFoundException.
> 
> But,I want result with null value if element not present in table2 .don't
> want error to throw in page
> 
> How solve javax.persistence.EntityNotFoundException with JPA (not by using
> @NotFound in HIBERNATE)
> 
> Could you please help.
> 
> -- 
> Thanks & Regards
> Prabu.N

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@oracle.com
P.S. A good JDO? O, Gasp!