dynamic entities
by Iyad Elian
Hi hibernate-dev,
I have an interest in modifying hibernate core to support an
alternative persistence model common in some domains like the medical
domain. how do I go about it?
here is a small description of the problem and a solution:
problem:
Objects map one to one to tables as specified at design time which is
normally what most applications require. Object relational mapping
runtimes like hibernate core cater well for this common case. However,
some applications require a catalog of entities and their attributes.
Other applications require a more dynamic mapping to a set of few
fixed tables regardless of the number of domain objects.
solution:
Persist entities to an EAVCR meta-model which stores values of
attributes in a generic Data table. The values can only be stored as a
generic type (String) but types can be tightened at runtime. This also
means that all dynamic entities, heterogeneous as they maybe, are
stored in one table and cataloged by a few more. Using such model
complicates the native SQL to access the data so it maybe necessary to
map the SQL to hide such complexity. Fortunately, domains using this
model require entity centric queries (load all data for a patient)
which is more coarse grained.
does this sound interesting to anyone on this list?
Thanks.
--Iyad
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
17 years, 6 months
Hibernate testsuite failures
by David Vrzalik
Hello,
I have been given notice that some of the tests from Hibernate testsuite are
expected to fail. My question is: are these tests just marked to be buggy and
planned to be rewritten, or are their failure required to indicate correct
behavior?
Many thanks in advance
David Vrzalik
17 years, 7 months
JPA: WAS 6.1 EntityManager performance and NPE in FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements
by Jesper Udby
Hello,
just trying to follow the guidelines in the section "READ THIS BEFORE
USING JIRA!", I'm submitting minor changes to the classes
WebSphereExtendedJTATransactionLookup and FromClause for anyone to review...
1. We are using Hibernate JPA with WebSphere 6.1 and are experiencing
serious bad performance. We are also seeing alot of "INFO
org.hibernate.util.NamingHelper.JNDI InitialContext properties:{}" in the
logs (as described in http://forum.hibernate.org/viewtopic.php?t=970086).
Our investigations shows that the logging statements come from
NamingHelper.getInitialContext().
Also, we can se that just creating an EntityManager from an
EntitManagerFactory results in 4 times InitialContext creation and 4 times
lookup of the WAS specific "java:comp/websphere/ExtendedJTATransaction".
A simple transaction results in 7-8 lookups !
By looking at a similar implementation in OpenJPA's
(openjpa-0.9.6-incubating) AutomaticManagedRuntime / WASManagedRuntime, it
appears that OpenJPA only looks up the "extended transaction" object once,
and stores it in a static.
I've changed the WebSphereExtendedJTATransactionLookup so the innerclass
TransactionAdapter ctor does the lookup and stores the
extendedJTATransaction in a static in the
WebSphereExtendedJTATransactionLookup class.
This solves our performance problems.
Now, the WebSphereExtendedJTATransactionLookup class is not heavily
documented (...) so it is not obvious to us if this breaks something else.
2. NPE in
FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements
We have 2 Named queries (defined as annotions on the relavant entity) that
basically breaks the Hibernate JPA initialization, as a
NullPointerException is thrown in line 120 of
FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements().
I've taken the liberty to change the "direction" of the equals in the
if-statement, assuming that the "specifiedAlias" is never null.
This solves the NPE problem.
Please find attached the 2 modified files and don't flame me if I'm not
following procedures.
Kind regards
Jesper Udby
Freelance I/T Consultant
17 years, 7 months