Now, lets talk about object persistence framework. It is Hibernate. How to generate tables in database from POJOs (Plain Old Java Objects). All that you need are:
1. Eclipse as IDE
2. MySQL 5 as Database
We also need other libraries such as:
1. Hibernate-3.*
2. MySQL-connector-java-5.*
3. Jakarta-commons
4. X-Doclet-1.*
To generate tables in database from POJOs with hibernate, we need mapping files (*.hbm.xml) for that POJOs. As example, User.java (a POJO) need User.hbm.xml that will be used to map that POJO with table in database. We also need a hibernate configuration file (hibernate.cfg.xml). It is needed to configure database properties with hibernate. In this example we will generate both of *.hbm.xml and hibernate.cfg.xml by using X-Doclet and Ant. Let's start it.
Firstly create database named ndung in MySQL.
Create a java project in Eclipse named HibernateExample. Create a new folder named lib. It is used to place our libraries. Move all libraries above to folder lib. So in the lib folder, there are 4 folders inside. Also add a properties file in the lib folder named lib.properties. This is an example, my lib.properties. It show my libraries configuration. Make it in your own. Also configure build path our project into these libraries.
lib.properties
In source folder make java package named com.ndung.model and com.ndung.main. We will place our POJOs in com.ndung.model and main file in com.ndung.main. Create java classes in com.ndung.model named User.java and HibernateUtil.java. In other side, create java class named Main.java in com.ndung.main.
User.java
HibernateUtil.java
Main.java
Now, we will generate User.hbm.xml and hibernate.cfg.xml automatically by using X-Doclet and Ant. Make two xml files in the project named properties.xml and build.xml.
properties.xml
build.xml
To run Ant based on our own build.xml file, in Eclipse menu bar click Window, click Show View menu item, and click Ant menu item. Ant panel will show up in the right of Eclipse. Right click on that panel, click Add Buildfiles. Choose build.xml to add from HibernateExample project. 4 menus will show up in that panel below HibernateExample. Double click on hibernatedoclet. It will generate hibernate mapping files and also a hibernate configuration file. Check out in source folder, there are 2 new xml files. They are User.hbm.xml in /com/ndung/model folder and hibernate.cfg.xml.
User.hbm.xml
hibernate.cfg.xml
Then double click on run in Ant panel. Now, check out your database.
Btw, Long Live My Indonesia...
Sunday, August 17, 2008
Hibernate First Impression
Posted by L.P. Manik at 1:40 AM
Subscribe to:
Post Comments (Atom)
257 comments:
1 – 200 of 257 Newer› Newest»Would you mind posting the source files for this example?
thanks
@Adam
Sorry, Now, i haven't time to upload source code. Maybe... Next Time...
where to buy ambien online generic name for ambien - side effects of generic ambien
xanax generic xanax pictures of pills - xanax and alcohol consumption
can you sniff diazepam diazepam zopiclone together - diazepam regime alcohol withdrawal
buy alprazolam online no prescription xanax 2mg dosage - xanax side effects upset stomach
xanax antidepressant does 1mg xanax look like - xanax .25 to get high
diazepam 10 mg diazepam 5mg spc - diazepam yahoo answers
xanax generic xanax side effects hiccups - buy xanax no prescription mastercard
diazepam online diazepam tablets 5mg - diazepam narcotic withdrawal
phentermine online buy phentermine 37.5 online no prescription - phentermine without rx
buy diazepam online diazepam side effects humans - generic brand for valium
phentermine online how to buy phentermine online no prescription - buy phentermine uk online
ambien medication ways get high ambien - ambien cr manufacturer coupon
buy generic phentermine phentermine online prescription - buy generic phentermine no prescription
ambien price ambien side effects long term use - ambien side effects mood
buy xanax without prescriptions xanax 60 minutes - xanax overdose wiki
buy ambien online no prescription buy ambien france - ambien medication for sleep
discount xanax xanax movie quotes - will 2mg xanax do anything
diazepam contraindications que es mas fuerte diazepam o clonazepam - buy diazepam valium
xanax 0.5mg xanax g3721 - buy xanax online europe
what is diazepam used for buy diazepam online no rx - generic diazepam images
buy generic phentermine buy phentermine online mexico - phentermine online+yahoo
buy diazepam diazepam dosage range - diazepam dosage by weight
order phentermine online buy phentermine online without tx - phentermine online order
generic zolpidem ambien side effects mayo clinic - ambien and breastfeeding
phentermine without prescription buy phentermine hcl 37.5 no prescription - phentermine forum 2012
buy ambien ambien miracle drug - ambien side effects the next day
carisoprodol 350 mg buy hgh - somatropin pills - buy somatropin pills
xanax for sale without prescription order xanax internet - xanax online order
order ambien online ambien side effects pregnancy - ambien cr 7 night free trial
buy xanax online overnight 1mg klonopin equal xanax - xanax 1mg image
buy alprazolam xanax pills information - xanax side effects last long
diazepam online cheap diazepam no prescription - diazepam 10mg prices
no prescription xanax xanax junkie - xanax overdose 1mg
diazepam diazepam uses - buy diazepam usa no prescription
order phentermine phentermine online paypal - buy phentermine in mexico
diazepam diazepam dose half-life - buy valium online paypal
ambien 5 ambien high blood pressure meds - ambien zolpidem tartrate 10 mg
buy phentermine buy real phentermine online - phentermine results in 1 month
ambien cr use ambien insomnia - ambien overdose child
ambien pills ambien cr 12.5 cost - ambien side effects liver
buy xanax online no prescription cheap how long does a xanax high last - 4 xanax overdose
buy tramadol online with mastercard tramadol online without rx - but tramadol online uk
soma online carisoprodol recreational - jugar cubo soma online
mixing diazepam and lorazepam valium diazepam que es - safe buy diazepam online usa
is it illegal to buy xanax online how much xanax and alcohol does it take to overdose - xanax side effects violent
buy ambien online without prescription ambien 73 93 - ambien side effects fatigue
can you sniff diazepam diaze 10 mg diazepam - diazepam (valium) synthesis
buy tramadol online buy tramadol online 100mg - tramadol hcl dosage humans
buy soma online somamedication.net - soma drug opiate
diazepam without prescription buy cheap diazepam online no prescription - diazepam usual dosage
cheap tramadol online tramadol 0 1g - buy tramadol in the uk
buy diazepam online diazepam 2 mg dzialanie - buy valium online no prescription
order tramadol online cod tramadol hcl mechanism of action - tramadol hcl and pregnancy
xanax for sale without prescription buy cheap xanax online no prescription - cheap xanax online no prescription
xanax without prescription can you take 2 mg xanax at once - xanax insomnia
buy tramadol medication tramadol 200mg high - buy ultram online with no prescription
intravenous diazepam diazepam 2mg asthma - diazepam 10mg for cats
alprazolam 0.5mg buy xanax from pakistan - metronidazole and xanax drug interactions
buy soma online soma drug test benzo - carisoprodol much get high
diazepam contraindications where to buy diazepam in the usa - diazepam 5mg anxiety
buy ambien online without prescription ambien dosage cr - generic name of ambien cr
buy tramadol hcl buy ultram online canada - tramadol 50 mg walmart
generic soma online somanabolic muscle maximizer legit - carisoprodol normal dose
buy cheap diazepam can you buy diazepam online - hk 10 mg diazepam
ambien on line buy real ambien online - cost of ambien cr 12.5 mg
buy tramadol cash on delivery tramadol for dogs dosage uk - tramadol hcl odt
purchase xanax xanax depression - best place to buy xanax online forum
soma online what drug category is soma - soma medication overnight
buy diazepam generic valium diazepam dosage equivalent clonazepam - diazepam highly addictive
buy ambien online ambien sound generator - buy ambien cr usa
buy tramadol overnight order tramadol american express - tramadol online reviews
order tramadol online mastercard tramadol 50mg recommended dosage - tramadol grasscity
buy tramadol no rx buy tramadol online missouri - tramadol dosage sr
order xanax xanax dose get high - xanax xr 1mg high
tramadol online tramadol 4 men - buy tramadol uk pharmacy
buy tramadol online tramadol hcl hcl - tramadol an 627 online
buy xanax buy xanax online in the uk - buy xanax online no rx
order tramadol tramadol yellow - tramadol hcl er 300
diazepam generics buy genuine diazepam online - diazepam indications
buy xanax without prescriptions xanax generic identification - smoking xanax high
buy tramadol tramadol dosage guide - tramadol hcl online
diazepam diazepam low dosage - diazepam dosage in elderly
buy tramadol cash on delivery tramadol dosage for humans - tramadol online with no prescription
ambien ambien 20mg - purchase generic ambien
buy tramadol online european online pharmacy tramadol - tramadol 50mg
soma online soma urine drug screen - buy soma online with cod
diazepam no prescription needed valium diazepam que es - buy diazepam mexico
where can i buy ambien online ambien rage - zolpidem er good ambien cr
buy tramadol with cod buy tramadol from canada - tramadol hcl pregnancy
soma online generic soma capsules - generic soma pill identification
ambien drug drug interactions propranolol ambien - ambien snorting
buy xanax online xanax bars colors - xanax side effects yahoo answers
buy soma online carisoprodol 700 mg - buy somatropin hgh
order tramadol online buy tramadol generic ultram - tramadol hcl 627
tramadol online overnight tramadol high drugs - tramadol opiate
buy tramadol online mastercard overnight cheapest ultra online - order tramadol
buy tramadol overnight cod tramadol high liver enzymes - tramadol 50mg pain killer
cheap tramadol tramadol 50 mg price street - tramadol tolerance
buy tramadol online tramadol online next day delivery - tramadol dosage veterinary
diazepam injection what is diazepam 5mg tablet - is diazepam for dogs the same as for humans
buy xanax online cod order xanax online pharmacy - xanax side effects in cats
buy tramadol cod next day delivery buy tramadol 99 - tramadol hcl dosage adults
generic ambien online 10mg ambien beer - ambien prices pharmacies
buy tramadol online mastercard overnight buy tramadol hcl online - tramadol hcl mechanism of action
pharmacokinetics of diazepam buy diazepam online no prescription needed - diazepam dosage to get high
carisoprodol 350 mg medicamento carisoprodol 350 mg - dosage of carisoprodol
tramadol online pharmacy buy tramadol 50mg uk - tramadol xl
ambien online pharmacy time between ambien and alcohol - ambien fail drug test
buy tramadol tramadol purchase cheap - tramadol online no prescription
diazepam dog diazepam backorder - valium diazepam side effects
soma drug where to get soma persona 4 - soma good drug
order tramadol online without prescription good site buy tramadol - tramadol hcl or vicodin
ambien pharmacy does ambien high feel like - buy ambien online no rx
xanax anxiety order xanax online india - xanax zoloft and alcohol
diazepam without a prescription diazepam 2mg effects alcohol - diazepam starting dose
soma drug buy hgh - somatropin online - carisoprodol liver damage
order tramadol online mastercard tramadol versus vicodin - trusted online pharmacy tramadol
ambien online without rx high from ambien - generic ambien less effective
buy xanax online overnight xanax for chronic anxiety - xanax pills pregnancy
buy tramadol online without a prescription tramadol gets me high - buy tramadol 99
buy tramadol without prescriptions order tramadol eu - tramadol 250 mg
xanax buy alprazolam 1mg side effects - buy xanax no prescription needed
buy discount tramadol buy tramadol online utah - tramadol hcl good pain
buy tramadol order tramadol online mastercard - buy tramadol online us pharmacy
diazepam online buy diazepam online no prescription usa - dose of diazepam
tramadol online buy tramadol eu - tramadol usage
buy diazepam online buy diazepam online in australia - how long does diazepam 10mg last
buy tramadol cod overnight tramadol gets me high - tramadol hcl hcl
ambien pill buy ambien online safely - buy ambien sleeping tablets
buy soma order soma online no rx - soma wellbutrin drug interactions
tramadol generic tramadol hcl webmd - tramadol get high off it
buy tramadol online tramadol 50 mg extended release - tramadol hcl high effects
buy soma watson brand soma online - carisoprodol side effects alcohol
buy diazepam dosage for diazepam 2mg - valium drug test how long
ambien sleep ambien sleeping pill wiki - cheap generic ambien online
buy tramadol online tramadol online tennessee - ordering ultram online legal
soma cheap generic soma capsules - generic soma pill identification
buy ambien online no rx ambien side effects bloating - buy ambien overnight shipping
buy tramadol in florida tramadol dosage bluelight - buy tramadol sr 100 mg
buy soma online buy-soma.com - soma todos medos online dublado
tramadol buy buy tramadol hcl 50 mg - buy tramadol online no prescription overnight
cheapest xanax generic xanax vs xanax - xanax withdrawal ocd
buy tramadol online cod overnight tramadol hcl-acetaminophen zen - high does tramadol get you
buy tramadol online tramadol hcl bp monograph - tramadol dosage back pain
diazepam drug buy diazepam line no prescription - diazepam dosage kids
generic xanax online generic xanax india - drug test does xanax show up
soma cheap soma drug use - carisoprodol 350 mg street name
buy tramadol mastercard tramadol hcl 50mg for dogs - tramadol withdrawal high blood pressure
buy tramadol uk tramadol veterinary use dosage - order tramadol online without prescription
buy soma online 350mg carisoprodol erowid - carisoprodol 350mg high
xanax antidepressant xanax side effects drinking - side effects xanax extended release
generic xanax Arlington 1.5 mg xanax high - xanax jewelry
buy xanax bars xanax drug interactions side effects - usual dosage xanax
cheapest xanax can u overdose xanax - xanax online forum
order tramadol online mastercard buy tramadol online us - tramadol used get high
buy tramadol overnight shipping buy tramadol 100mg - buy tramadol online overnight shipping
xanax 2mg 1.5 mg xanax withdrawal - order xanax cod
buy xanax online no prescription overnight buy xanax online canada no prescription - xanax withdrawal length of time
alprazolam drug drug test valium xanax - xanax names
buy xanax xanax withdrawal symptoms sweating - blue xanax pills generic
generic alprazolam xanax withdrawal success stories - drug interactions xanax geodon
xanax online Columbus buy alprazolam online - xanax-effects.com
order tramadol tramadol bluelight - can you get tramadol online legally
where can i buy ambien online type high ambien - highest dosage ambien prescribed
xanax pill xanax withdrawal neck pain - what is xanax drug class
alprazolam drug buy xanax online no prescription cheap - xanax overdose much too much
xanax online Portland xanax overdose possible - xanax dosage how supplied
xanax online New Jersey 2mg xanax round pill - xanax withdrawal valerian
buy xanax xanax side effects body - generic xanax 15mg
buy xanax online Indianapolis xanax withdrawal + valerian root - what is xanax used for yahoo
xanax online no prescription buy xanax online forum - drug interactions concerta xanax
buy xanax online without rx xanax zyprexa - effects of quitting xanax cold turkey
buy ambien ambien side effects reviews - ambien cr 7 day free trial
buy xanax online no rx generic xanax pictures of pills - xanax zolarem 1mg
buy ambien buy ambien online with mastercard - ambien dosage 10
buy xanax online Texas xanax 1.0 side effects - order xanax bars
buy xanax New York xanax and alcohol high - xanax kava
buy xanax xanax for depression - xanax online safe
xanax online prescription effects xanax vicodin - drug schedule of xanax
alprazolam 0.5mg buy xanax online cheap no prescription - xanax dosage weight
buying ambien online where to buy ambien in canada - ambien cr extended release
buy xanax online xanax and alcohol combination - xanax overdose do
ambien buy ambien cr dosage information - ambien dosage 20
buy xanax online Seattle can overdose xanax kill you - xanax side effects sleep
ambien online pharmacy ambien lithium drug interactions - buy ambien online legally
buy xanax bars online does xanax show up drug test long - alprazolam gp 0 5mg
buy ambien generic name of ambien cr - ambien sleep meds
can you buy xanax online legally what is xanax medication used for - xanax much get high
buy ambien ambien quitting - mail order ambien
cheapest xanax generic xanax photos - xanax blood drug test
buy xanax online Kansas generic version of xanax - can you buy xanax cancun
ambien without a rx ambien meditation music online - generic ambien photos
buy xanax drug schedule of xanax - buy xanax discover card
xanax online Baltimore valium vs xanax recreational use - recovering xanax overdose
buy ambien online ambien vs xanax high - ambien drug guide
xanax online Iowa buy generic xanax no prescription - buy xanax online no prescription overnight
buy alprazolam xanax used opiate withdrawal - paxil for xanax for anxiety
generic zolpidem generic form of ambien cr - ambien cr using side effects
Post a Comment