[hibernate-dev] [OGM] RowKey vs. EntityKey
Emmanuel Bernard
emmanuel at hibernate.org
Mon Nov 11 07:30:24 EST 2013
As we discussed on Irc but for posterity.
EntityKey represents what you need to reach an entity. It contains both the actual id information and the metadata necessary to do the query.
Likewise, we have AssociationKey that does represent an association navigation.
RowKey is used to represent two things:
- each entry key in an association navigation (which is conceptually a map)
- the unique identifier to reach a sequence or a table generator entry
I tend to like the fact that these are typed differently so in a way I'd split the RowKey in two more than merge everything together. If anything it makes is easier for a GridDialect writer to understand what's going on. Davide pointed out that a common super interface might be useful in a couple of places.
Emmanuel
On 8 nov. 2013, at 13:20, Gunnar Morling wrote:
> Hi,
>
> This may be a noob question, but what is the difference between RowKey and
> EntityKey in OGM?
>
> Both seem to represent one row (by means of table name + key column names +
> column values), albeit being implemented a bit differently. Could they be
> merged into one class?
>
> Thanks,
>
> --Gunnar
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
More information about the hibernate-dev
mailing list