openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <maxtorz...@gmail.com>
Subject Re: Problem with Criteria-API and fetch (properties of related entities are NULL)
Date Wed, 06 Mar 2013 18:46:56 GMT
mmm i never used that before, why you dont consider this:

In your inventory table just create a primary key (numeric) and then add
the reference of your User in this table (you can use a unique constraint
if you dont want duplicates users).


2013/3/6 Riccardo <riccardo.nimser@s2000.tu-chemnitz.de>

> With JPQL and the Criteria-API I get the exact same result.
>
> Other Entities work for me too, but in this case I use a mapping of derived
> identities as specified in JSR 317 section 2.4.1. So, the primary key for
> my
> inventories is another entity (User).
>
> @Entity
> public class Inventory implements Serializable {
>    @Id
>    @OneToOne(fetch = FetchType.EAGER)
>    @JoinColumn(name = "Owner", referencedColumnName = "Id")
>    private User owner;
>
>    ...
> }
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Problem-with-Criteria-API-and-fetch-properties-of-related-entities-are-NULL-tp7582995p7583035.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message