Saturday, August 07, 2004
"There are two varieties of one-to-one association:
*
primary key associations
*
unique foreign key associations
Primary key associations don't need an extra table column; if two rows are related by the association then the two table rows share the same primary key value. So if you want two objects to be related by a primary key association, you must make sure that they are assigned the same identifier value!
For a primary key association, add the following mappings to Employee and Person, respectively.
Now we must ensure that the primary keys of related rows in the PERSON and EMPLOYEE tables are equal. We use a special Hibernate identifier generation strategy called foreign:
employee
...
class='Employee'
constrained='true'/>
A newly saved instance of Person is then assigned the same primar key value as the Employee instance refered with the employee property of that Person.
Alternatively, a foreign key with a unique constraint, from Employee to Person, may be expressed as:
And this association may be made bidirectional by adding the following to the Person mapping:
"
*
primary key associations
*
unique foreign key associations
Primary key associations don't need an extra table column; if two rows are related by the association then the two table rows share the same primary key value. So if you want two objects to be related by a primary key association, you must make sure that they are assigned the same identifier value!
For a primary key association, add the following mappings to Employee and Person, respectively.
Now we must ensure that the primary keys of related rows in the PERSON and EMPLOYEE tables are equal. We use a special Hibernate identifier generation strategy called foreign:
employee
...
constrained='true'/>
A newly saved instance of Person is then assigned the same primar key value as the Employee instance refered with the employee property of that Person.
Alternatively, a foreign key with a unique constraint, from Employee to Person, may be expressed as:
And this association may be made bidirectional by adding the following to the Person mapping:
"
Chapter?5.?Basic O/R Mapping having a problem with hibernate mapping... its a bit different than the ejb way am used to...
Wednesday, August 04, 2004
ok, migrated the layers to spring and hibernate... basically the apps i design has the following layers:
POJO - directly maps to each record on a table
DAO - contains data access methods for each POJO
Service - the business logic which often spans to several DAO's
Managers - the front end friendly wrapper for the service
spring really separates these layers nicely...
POJO - directly maps to each record on a table
DAO - contains data access methods for each POJO
Service - the business logic which often spans to several DAO's
Managers - the front end friendly wrapper for the service
spring really separates these layers nicely...
ok... on the coding front... was able to manage having the backend buildable via the CLI (command line interpreter or a shell etc)... was able to do cheesy unit testing because everything is now accessible even without an EJB CMP/CMR container... sweet :)... spring also literally separates the layers so all in all everything is much more flexible now... the next task is to remove resin dependencies so that i can make this thing work on suns free application server...
Monday, August 02, 2004
just to recap on what works on the degatto running on gentoo linux...
clie peg-tj37 works! i suggest to stick with copy from pda option for gnome-pilot tho. mounting usb-mass storage devices worked for me without a hitch, both the digicam and clie memsticks are recognized as /dev/sda1 devices... sound works nicely as well as playing dvd's and vcd's etc via totem... rhythmbox takes care of streaming audio... the msi cb54g wireless lan card works via the ndiswrapper... ok, back to work... will get back on this latter...
all in all i can everything "Mostly Works" (TM) ;)
clie peg-tj37 works! i suggest to stick with copy from pda option for gnome-pilot tho. mounting usb-mass storage devices worked for me without a hitch, both the digicam and clie memsticks are recognized as /dev/sda1 devices... sound works nicely as well as playing dvd's and vcd's etc via totem... rhythmbox takes care of streaming audio... the msi cb54g wireless lan card works via the ndiswrapper... ok, back to work... will get back on this latter...
all in all i can everything "Mostly Works" (TM) ;)
Sunday, August 01, 2004
Mischiefblog ? Hibernate and Spring: Lessons Learned... funny i cant find anything mentioning aopalliance.jar on the springframework.org... oh well... i spent the better wee hours this morning why my downloading spring package doesnt have it... :(
Thursday, July 29, 2004
Wednesday, July 28, 2004
am going to approach this project with a bit more maturity this time... Ant and xdoclet to allow things to be buildable even on the CLI... with luck this is gonna pay off in the long run... and hopefully increase my family time sched... i miss playing with my dear rojan... ahhhhhhhh... the trade-offs of 14-16hrs working habbits... am an obsessive compulsive and i just wont admit it... doing things that i like is soooooooo addicting... am struggling to schedule things properly, or rojan might stop winking on me. and that, me really thinks, can slice my heart to pieces...
am tired of ejb cmp/cmr... after successfully having a working project based on it, time has come that its ugly heads are starting to sprout like crazy... the time consuming cycle of container deployment is too much to ask for a super hectic schedule bound mortal like me... more on this later... for now am sticking to spring+hibernate and would dip into jdo as well... sigh...
Tuesday, July 27, 2004
naivete
sigh, found some old weezer mp3... one of the few bands i really like, i hope i could play the guitar like i used to... the sweater song undone
song brings back memories of those naive younger years when weezer and
nirvana and a local band like the eraserheads used to make music that
comes from the bottom of their adolescent/post-adolescent hearts...
song brings back memories of those naive younger years when weezer and
nirvana and a local band like the eraserheads used to make music that
comes from the bottom of their adolescent/post-adolescent hearts...
Thursday, July 22, 2004
Wednesday, July 21, 2004
had a hard time configuring hibernate synchronizer... after digging into the docs and googling insanely for an answer, i was able to pinpoint the problem... it apparently uses velocity with default settings of writing its velocity.log to /... of course this is not permissible! here's to unjarring and editing the default velocity properties files...
sigh...
sigh...
Monday, July 19, 2004
Gentoo Linux ... awright, have to admit... am a gentoonite now... an alter ego to be more exact... i still a die hard bsd fanatics for servers... but for an opensource laptop os, am a gentoo linux convert now...
Subscribe to:
Posts (Atom)