0

I'm writing a JPA connector to a legacy sistem. The problem is, DB design in the system is.. well.. horrible.

I need to implement an entity that maps to three tables. I can do it using named sql queries, but the probem is, I have to use this entity in a OneToMany relation (this entity is on the many side). So how do I tell JPA it needs to use a specific named query with specific parameter?

And a subquestion: does any1 have any good on-line JPA documentation? I can't find anything decent :-/

4

3 回答 3

1

我实际上还没有找到用 JPA 做到这一点的方法。为了解决这样的问题,我最终使用了命名查询。

就文档而言,我一直在使用TopLinkHibernate 的.

如果您找到更好的方法,请在此处发布!

于 2008-11-06T19:35:11.677 回答
0

看看@SecondaryTable(s)。Pro EJB 3 Java Peristance API book, page 237中有一些例子。

于 2009-08-12T18:28:41.343 回答
0

您能否制作一个数据库视图,然后创建一个映射到该视图的实体?我不知道这是否可能,只是一个想法。

于 2009-01-15T20:17:23.823 回答