Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate with Swing

 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

is there a way to use Hibernate with Swing without manaul entering in the Querys ?

What i would like is to have Hibernate.cfg.xml to look after the database Tables along with CRUD..
by using hbm2ddl.auto..

Within my Jpanel if i have two Buttons Next and Back would hbm2ddl.auto work with this to populate the JTextField with the Info.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why there would be a problem using Hibernate in a Swing application. Mind you I don't know exactly what you mean by "manual entering in the queries", and I don't know why those queries should be present in Swing applications and not in, say, web applications. So how about if you tell us what you have tried so far and what problems you have encountered?
 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I havent Tried anything yet, i am looking at a Small project to build..
and was looking at doing the Data Model with Hibernate. what i meant by "manual entering in the queries", was with Hibernate you don't have to use INSERT INTO table_name
VALUES (value1,value2,value3,...); etc you can leave that up to the Auto Build.


but what i would like to know can this "Auto" build feature work with Searching for First name Last Name etc.

without me having to type in something like this

SELECT * FROM Customers
WHERE FNAME=value;

And have them Link that Query up to Text Fields.

I want this to be done only with Jpanels / jFrames i have yet to look at Spring or Struts to build something like this into a Web Application..
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "auto build"? That doesn't ring a bell.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm not mistaken, "hbm2ddl.auto" refers to the Hibernate feature whereby it will automatically generate database tables based on the Hibernate configuration. And that doesn't have anything to do with queries which you might want to run against those database tables.

David, I'd strongly recommend you stop designing and spend some time working your way through the Hibernate tutorials. Right now it seems like you have a few unfocused concepts floating around in your mind, and you need to figure out what they really mean. So far you haven't even got to the point where you can ask a reasonable question about them.
 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

currently I am watching java bean youtube vidoes would you recommend any

so the hbm2ddl only creates the tables, you cant use it to query the tables?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic