|
From: Trevor C. <pr...@se...> - 2003-10-20 02:31:33
|
Cool. I might actually be able to learn more about Hibernate now (lots =
of desire, absolutely no time :) ).
>>auto-increment just allows to read in the actual id afterwards
This is not reliable for concurrent inserts (which is why I generally =
use sequences. For the sample this should be sufficient though.
Trevor
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of j=C3=BCrgen h=C3=B6ller [werk3AT]
Sent: October 19, 2003 6:48 PM
To: spr...@li...
Subject: [Springframework-developer] Petclinic Hibernate implementation
Hi everybody,
=20
I've just finished something that I wanted to get in M2: a Hibernate =
implementation of Petclinic! The main rationale is to provide a working =
Spring/Hibernate sample app -- adapting Petclinic was the easiest way. =
And it's nice to switch between the JDBC implementation and the =
Hibernate one... The new impl is basically just an alternative =
implementation of the Clinic business interface, but I've generally =
refined that interface and the domain objects in the course of the work. =
I've also renamed the root package from "petclinic" to =
"org.springframework.samples.petclinic", analogous to the countries =
demo.
=20
Generally, everything works nicely so far on both implementations. =
There's one issue though: HsqlJdbcClinic uses HsqlMaxValueIncrementer =
for id generation, with one sequence table per domain table. Hibernate =
doesn't have a similar id generation strategy, so I'm wondering what to =
do to make both impls work on the same database. The Hibernate docs say =
that HSQL supports "identity" for id columns; why are we not using this =
for HsqlJdbcClinic too? I.e. making the id columns identity columns and =
getting rid of all the sequence tables. I guess there's a drawback with =
this; can anyone shed some light on the issue?
=20
BTW, we are using auto-increment for all MySQL databases at werk3AT, and =
it works nicely. I'd really like to understand the rationale for manual =
sequence handling. The only one I see is that the id can be determined =
before the domain insert/update statement this way, while auto-increment =
just allows to read in the actual id afterwards. But does that really =
matter for Petclinic? Wouldn't it be easier to use =
auto-increment/identity on both MySQL and HSQL?
=20
This issue is pretty urgent actually, as I'd like to get M2 out mid next =
week; that's already slightly behind the original schedule with a =
release this weekend. I believe that a working Spring/Hibernate sample =
(the number one question on the Hibernate forums) is worth a slight =
delay, though.
=20
Juergen
=20
P.S.:
Jean-Pierre, what's the status of your Light-Countries sample? Do we =
really need it? Countries configured to the memory DAO should be nice =
enough... I do not intend to include it in distributions, for the time =
being.
=20
P.P.S.: To make the Hibernate impl of Petclinic work out-of-the-box, we =
need to ship the main libraries of Hibernate 2.0.3 with Spring. That's =
1.6 additional MBs, without the JCS cache. Does anyone object to that?
=20
P.P.P.S.:
Why is "MySQLMaxValueIncrementer" written with upper-case "SQL" but =
"HsqlMaxValueIncrementer" not? Is it just because CVS doesn't support =
case renaming? ;-)
=20
+=12=17 ?[){([ ' +=1E.) Z+??`zw=1E Li8^=12Z+.) =
6??ig [ +kj?"8^=12{^? b^=06?v(=17?9 q {ay' ? 0 +=1E) +o o =
*kx=1F ?zZ)zXX*kx=1F? ?zZ)z l .a=1Ew i +-(=1E~ { b ?+-w k?x=1F? =
?zZ)
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003
|