Well, you could probably use a <join/> mapping. The only difficulty would be
the multiple keys IIRC.

Usually your domain model should be more granular than the database so you
might want to just leave this a one-to-* relationship and create a
calculation entity. You also create a composite key of Account_ID + Date in
the DB that would give you a single unique key that you could join on.

On Tue, Feb 9, 2010 at 9:37 AM, Maik <[email protected]> wrote:

> Hi there,
>
> I have maybe a simple question about a mapping problem I'm facing
> right now.
>
> The situation can be described as follows:
>
> the following tables are needed:
>
> ACCOUNT
> (
> (PK) ID ,
> NAME
> )
>
> CALCULATION
> (
> (PK) ID
> (FK_ACCOUNT) ACCOUNT_ID,
> DATE,
> VALUE
> )
>
> ACCOUNT_SUB
> (
> (PK) ID ,
> (FK_ACCOUNT) ACCOUNT_ID,
> GROUP_ID
> DATE,
> VALUE
> )
>
> The mapped calculation-object now should include the value from the
> account_sub-table, whereas it has to be selected by multiple
> parameters GROUP_ID (fix value) and the relevant date from the
> calculation.
>
> Is it possible to solve this issue with a simple mapping or do I have
> to query this via criteria or hql?
>
> Regards
> Maik
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to