Saturday, August 07, 2004

its 3am and am really getting frustrated with hibernate to do my bidding... to some extent its working but why i DO NOT like the sql queries produced by hql... sigh... maybe i should go with teh sql way of doing things since hibernate does support this method...
"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:



"
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...
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...

this face inspires me to do the imposible, reach for higher goals, and brings hope on this lowly geek to face the formidable challenges of today and tommorow... and last but not hte least, never fails to make me smile and laugh... ahhh the simple joys of being a father... am a ROJAN fanatic!!!

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) ;)

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... :(