Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

  2. #22
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    I don't really see this going anywhere because you are not being specific with what you are saying. e.g
    Quote Originally Posted by Tolls View Post
    Sorry, that doesn't generally work. You are still reliant on auto-generated stuff. As with (for example) a GUI generator in an IDE (say Netbeans), the code is generally less than impressive. Have you seen some Hibernate queries?...
    Are we still talking about creating database tables? If you need to write queries you can still write queries using JPAQL or create native queries.
    In what way is netbeans generated GUI code similar to hibernate generated queries?


    Quote Originally Posted by Tolls View Post
    ..
    I develop apps. An app has a front end, a business layer and a persistence layer. Yes, each part should not have to care (beyond the specification of interfaces) how the other bits work. The back end, though, should not be left to some auto-generated stuff...it should not treat (again) the db as a black box. It's a sure fire way to get yor DBA annoyed with you...:)
    ...
    What exactly do you mean by treat the db as a black box? What in the application code should be DB specific?

    Quote Originally Posted by Tolls View Post
    ...
    Nope, see above. Each db is different. Shifting from one to another is not a simple task. As I say, the data in the db is rarely used by a single app. That's where the JPA falls down, to be honest..
    JPA doesn't fall down at all if you really understand it.

    Database tuning should be done in database specific ways but the application code has no business with any of that. I already mentioned that it should be done but it in no way affects the design of the tables which comes from the relationships of objects in the problem's model.
    A well written application separates concerns so that different people (with different expertise) can work on different parts at the same time.

  3. #23
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    Quote Originally Posted by r035198x View Post
    I don't really see this going anywhere because you are not being specific with what you are saying. e.g

    Are we still talking about creating database tables? If you need to write queries you can still write queries using JPAQL or create native queries.
    In what way is netbeans generated GUI code similar to hibernate generated queries?
    Setting up the db for the app, which includes the tables. Yes. Indexes, views, etc. As for queries, as soon as you're writing your own queries, especially native, you need to know how the db you're working with actually works, so the whole "not needing to know the db" becomes a bit moot, surely?

    As for generated queries and generated code (ie Swing), neither produces particularly good code. Functional maybe, but rarely good. That is the similarity.

    Quote Originally Posted by r035198x View Post
    What exactly do you mean by treat the db as a black box? What in the application code should be DB specific?
    That's the point. If an app has persistence in a db the db (tables etc) is part of the app. Yes, certain layers don't need to know about the db, but some layer does. And coding on the basis that "it'll know how to set the db up" will create poorer apps.

    Quote Originally Posted by r035198x View Post
    JPA doesn't fall down at all if you really understand it.

    Database tuning should be done in database specific ways but the application code has no business with any of that. I already mentioned that it should be done but it in no way affects the design of the tables which comes from the relationships of objects in the problem's model.
    A well written application separates concerns so that different people (with different expertise) can work on different parts at the same time.
    The app includes the db. That's my whole point.
    A query is as much a part of the app as a particular JPanel.
    A table index is as much.
    And so on.

    I get the feeling you're using the term "application" when you really mean a layer, or layers.

  4. #24
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

    Default

    @berlindutza

    Create a table in your own. You can't be that lazy. All you need to do is create a table rest gets generated automatically. Tell us about ur results.

  5. #25
    berlindutza is offline Member
    Join Date
    Aug 2009
    Posts
    25
    Rep Power
    0

    Default

    I installed the HibernateTools. They have helped me a lot because, for example I didn't have to write hibernate.cfg.xml by myself.
    I have put the following xml tag in hibernate.cfg.xml:
    Java Code:
      <property name="hibernate.hbm2ddl.auto">create-drop</property>
    I figured out, that if the tables weren't created, Hibernate would create them for me.
    Momentarely I'm trying to learn Hibernate (regarding databases I have passed the beginners level) and it is more convenient to let Hibernate create tables.
    It is true that I can't see how the tables are created and that is a bit strange for me.

    Thanks all for your support!
    I have learnt some interesting thinks!

  6. #26
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

    Default

    but still i wud suggest u to create tables in your own and let hibernate do other stuffs.
    r u using netbeans?

  7. #27
    berlindutza is offline Member
    Join Date
    Aug 2009
    Posts
    25
    Rep Power
    0

    Default

    I'm using Eclipse.
    Last edited by berlindutza; 02-25-2010 at 12:00 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 12-01-2009, 10:01 PM
  2. problem with getting alll schema names from database
    By sandeepsai17 in forum New To Java
    Replies: 1
    Last Post: 07-21-2009, 12:38 PM
  3. Automatically Generate an XML file
    By svpriyan in forum XML
    Replies: 2
    Last Post: 06-25-2009, 05:46 AM
  4. Hibernate with multiple database
    By Marty in forum JDBC
    Replies: 3
    Last Post: 12-23-2008, 12:57 PM
  5. Generate <UL> list from Database with sub categories
    By itsnexgen in forum New To Java
    Replies: 4
    Last Post: 09-29-2008, 07:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •