- In Netbeans 7.2 create a new Java Application Project
- Add a connection to your database in Services tab –>Databases
- Copy all JPA entity classes in your project (in correct package)
- In newly created java app project right click on “Source Packages” –>New –>(Other)->Persistence Unit
- In New Persistence Unit dialog:
- Persistence LIbrary = Hibernate (JPA 1.0) (I tried with hibernate 4.1.9 and jpa 2 but is not working)
- Database connection = chose your db connection
- Table generation strategy = none
- Edit your persistence.xml
- In design tab –> Include Entity Classes –> add all of them
- In the source tab –> add the hibernate.dialect property e.g.
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
- Right click on your project and in Build –>Packaging->select Copy Dependency Libs (this will create a lib folder with all you need in the dist folder)
- Build your project
- Right click on your project and in Build –>Packaging->deselect Copy Dependency Libs (this will create your jar without references to other jars – perfect for squirrelsql)
- Build your project again
- In Squirrel File –> Global Preferences –> Hibernate: create a new configuration
- With “Add classpath entity” button:
- add jars for your jdbc driver
- add all jars in from your_java_app/dist/lib
- add your exported java app jar from dist folder
- select call … persistence-unit and complete persistence-unit name
- Select Run Hibernatate in SQuirreL’s Java VM
- Hit Apply Changes to this configuration and OK
After you’re connected to your db in the Hibernate tab is all the magic
This is the key point: "(I tried with hibernate 4.1.9 and jpa 2 but is not working)".
ReplyDeleteSquirrelSql works correctly only with hibernate 3.x.
You can find a patch for squirrel to work with hibernate here: http://pastebin.com/yinBqy4m
ReplyDeleteHow to use the patch?? any idea!!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteYour good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeleteAWS Training in Bangalore
AWS training in sholinganallur
AWS training in Tambaram
AWS training in Velachery
This comment has been removed by the author.
ReplyDeleteSimply wanted to inform you that you have people like me who appreciate your work. Definitely a great post.
ReplyDeleteHats off to you! The information that you have provided is very helpful.
aws training in chennai | aws training in annanagar | aws training in omr | aws training in porur | aws training in tambaram | aws training in velachery
Great Post,really it was very helpful for us.
ReplyDeleteThanks a lot for sharing!
I found this blog to be very useful!!
Salesforce Training in Chennai | Certification | Online Course | Salesforce Training in Bangalore | Certification | Online Course | Salesforce Training in Hyderabad | Certification | Online Course | Salesforce Training in Pune | Certification | Online Course | Salesforce Certification Online Training Courses
Wonderful blog with great piece of information. Regards to your effort. Keep sharing more such blogs.
ReplyDeleteLooking forward to learn more from you.
oracle training in chennai
oracle training in porur
oracle dba training in chennai
oracle dba training in porur
ccna training in chennai
ccna training in porur
seo training in chennai
seo training in porur
en son çıkan perde modelleri
ReplyDeletelisans satın al
özel ambulans
uc satın al
en son çıkan perde modelleri
yurtdışı kargo
nft nasıl alınır
minecraft premium
çorum
ReplyDeleteantep
ısparta
hatay
mersin
0FİWEU
salt likit
ReplyDeletesalt likit
dr mood likit
big boss likit
dl likit
dark likit
10YD
Thank You and that i have a neat present: Where To Remodel House whole home renovation cost
ReplyDelete