This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Java desktop database app with JPA and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Java desktop database app with JPA and Hibernate" Watch "Java desktop database app with JPA and Hibernate" New topic
Author

Java desktop database app with JPA and Hibernate

Marcel van der Ven
Greenhorn

Joined: Mar 20, 2010
Posts: 14
Hello,

My name is Marcel from the Netherlands and I am new to this forum.
I am already familiar with C++ and now I want to learn Java, I already have code a couple of programs and read a couple of books about Java.
And now I am working on a bigger application which I will use as a practice for my preparation for the SCJP certification, I came here because I have a couple of questions about Hibernate/JPA.

I am designing a desktop database application for a company, this application is going to be used for customer orders, purchasing orders, customer data, invoices, production etc.
The designing phase (UML diagrams and database model) is almost finished and I have created a lot of tables and joins, I am now almost at the stage of going to write the code.
I am using Netbeans IDE 6.8 and MS SQL Server 2008 Standard edition.

The question that I have are as follows:
  • I want to use the JPA to map my tables to object oriented classes, in Netbeans you have the opportunity to choose between TopLink and Hibernate. I am thinking of using Hibernate but on the Internet I see only Hibernate and web application examples. Can you use Hibernate for Desktop database application, or is there a better solution for this?
  • The database that I have designed is composed from a lot of tables (more than 50), my question is how do you code this into Netbeans, do you make one big project and put there all your Entity classes, or do you divide this into packages (corresponding to the schemas in the database)? Or make multiple projects?
  • How does Hibernate work with MS SQL Server, and how does Java. On the Internet I see not much examples where the use Java technologies and MS SQL Server, is this not a good combination?
  • Are there any good books about this topic (Hibernate) that can be used for the development of desktop database applications?


  • Thanks,

    Marcel van der Ven
    David Newton
    Author
    Rancher

    Joined: Sep 29, 2008
    Posts: 12617

    There's no difference between environments as far as Hibernate is concerned.

    Any DB that has a JDBC driver works with Java.
    Vlad Varnica
    Ranch Hand

    Joined: Dec 28, 2002
    Posts: 40
    I don't know NetBean but if you use Eclipse then you can convert your Database into Java code and then reverse this code inside a class diagram.
    I have found this tutorial : http://www.forum-omondo.com/documentation_eclipseuml_2008/Eclipse_Database/Activate_JPA_Perspective/oracle_integration.html

    The database to java code conversion is provided by Oracle free Eclipse tool and then you can use either EclipseUML Omondo as explained in the tutorial or any other modeling tool having reverse engineering feature.
    Shashank Acharya
    Greenhorn

    Joined: Mar 20, 2010
    Posts: 21

    If you plan for Netbeans 6.8 is superb. You will nice tutorials of JPA & Hibernate,Hibernate with JPA from Netbeans.

    Also here are some links which are useful to you to work on with Hibernate & JPA.

    http://netbeans.org/kb/docs/java/hibernate-java-se.html
    http://wiki.netbeans.org/BestPracticesWithJPAAndBeansBinding
     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: Java desktop database app with JPA and Hibernate
     
    Similar Threads
    Hibernate @Table annotation, database schemas
    Software Applications Knowledge Transfer
    How to couple JPA entities to a GUI?
    Java, J2EE, Swing/SWT Developer (Work From Home)
    Requirements for building Java GUI to access MySQL Database