This content has been marked as final.
Show 4 replies
-
1. Re: How do I do mapping for a view?
dornus Nov 1, 2005 12:06 PM (in response to dornus)Here is an example of a view with 5 tables. How would I represent this using par/ejb3?
CREATE VIEW myView AS select a.One, a.Two, a.Three, a.Four, a.Five, a.Six, d.Seven, c.Eight, b.Nine, a.Ten from (TableA a join (TableB b join (TableC c join (TableD d join TableE e)))) where ((a.One = e.One) and (e.One = 1) and (c.Eight = a.Nine) and (d.Two = c.Two) and (a.Three = d.Three))
-
2. Re: How do I do mapping for a view?
dornus Nov 1, 2005 12:13 PM (in response to dornus)I have tried making a par
@Entity @Table(name = "myView") public final class MyTestPar { int One; String Two; String Three; String Four; String Five; String Six; String Seven; String Eight; String Nine; String Ten; //I made generic get and sets for each variable shown above }
Now when I do thisreturn em.createQuery("from MyTestPar p ");
I get no results. However If I look in the database, my view contains 5 rows. -
-
4. Re: How do I do mapping for a view?
epbernard Nov 4, 2005 6:20 AM (in response to dornus)this is supposed to work as expected. Be sure to disable the hbmddl feature though by setting none