How can I use a wrapper object as a JPA entity without having a corresponding table in the database -


I am creating a system over an existing (old and dirty) database. For this, I am creating a JPA layer above the database, but I do not want to map my domain objects directly into the existing database tables.

Do I currently have a wrapper object which is a way of databases in 4 entities (data 4 tables from which) can I use this wrapper class as a parameter in JPQ query?

It would be nice if the wrapper class itself works like some JPA unit, but without the related database table, for example, let me call it wrapper

 < How should the public class cover be changed? Personal firstpenetiti first; Private secondjpnty second; }   

so that I

  list & lt; wrapper & gt; Wrapper = ...; TypedQuery & LT; Cover & gt; Query = entityManager.createQuery ("Select Wrap" // Probably this is the problem where the problem is: JPA requires a type of `wrap`, but this type of entity is required, which is called` Wrap 'is not' WHERE wrap in: wrapper "+" and wrap.first.property = 1 "+" and wrap.second.property = 2 ", wrapper class); Query.setParameter ("wrapper", wrapper);   

I was looking at making wrappers in an @ embedded, hoping how JPQL could detect it, but alas < p>

Perhaps you can use in your wrapper class through animation / mapping?

In this way, your cover can be composed of four built-in tables but the cleaner interface in an app.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -