Hi Venkat,

JPA knows the @Embeddable, @Embedded and @EmbeddedId annotations to "embed"
an object representation of a composite key in a containing object.
@IdClass provides a slightly different mechanism for the same use-case.

Now, I personally think that this is a bit of a limiting solution,
introducing more impedance mismatch between Java modelling, JPA modelling
and relational modelling. It is useful in some cases to treat the columns
of a composite key as if they were a single unit. However, this should not
be enforced. Users shall have the liberty to choose whether they want to:

- Combine key columns in a single unit
- Separate key columns and access them independently

The latter is especially true for columns that participate in more than one
composite foreign key.

Nonetheless, JPA's notion of "embedding" and also some JPA implementations'
proprietary notion of "fetch groups" (e.g. EclipseLink, OpenJPA) could be
interesting to jOOQ in the long run. I don't even think that grouping
columns into units of work is a use-case limited to composite keys, or even
strictly related to composite keys. This is often also useful for common
column groups, such as CREATED_BY, CREATED_AT, MODIFIED_BY, MODIFIED_AT. Or
FIRST_NAME, LAST_NAME. Etc...

Such a feature addition is on the roadmap:
https://github.com/jOOQ/jOOQ/issues/2530

Column groups could be configured in the code generator. Generated column
group types would certainly include:

- org.jooq.Record types
- org.jooq.Row types

The exact implementation strategy is not very mature yet, though.

Cheers
Lukas

2013/7/6 Venkat Sadasivam <[email protected]>

> I need think a bit more. JPA generates separate class for composite key
> whereas your generator doesn't. I want to know your thoughts on this
> difference.
>
>
> On Friday, 5 July 2013 03:06:21 UTC-4, Lukas Eder wrote:
>
>> Yes, jOOQ supports composite keys. What exactly is your question? Can you
>> be a bit more specific?
>>
>>
>> 2013/7/5 Venkat Sadasivam <[email protected]>
>>
>>> Does jOOQ supports composite key? what is your suggestion to make JPA
>>> like composite key support?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jooq-user+...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to