> This has come up recently; the simple idea is that the when injecting
> a Hibernate Session and additional annotation may be present to
> identify *which* session to inject.
i.e.
@CommitAfter("unit1")
JPA already defines something like this does anyone have an opinion on using
@Inject vs. @PersistenceContext("unit1")?
> However, this raises another
> problem ... ValueEncoders and determining which session to use to
> convert from a string id back to an entity. If the same entity can
> appear across multiple PUs, this becomes an intractable problem.
For the same entity in multiple PUs, with JPA 2.0 you can get the Metamodel
from the Persistence Unit to lookup the entity, and you could build a Entity ->
PU mapping. If you want to tweak which mapping gets used by the ValueEncoders,
it seems like then you could just have some way of configuring that.
But I think the 90% case is for loading two different data models living in
two different databases so I wouldn't be rushing to support that.
Pierce
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org