facebook

Hibernate Wizard, Abstract Class use for Form Beans

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #214964 Reply

    I noticed that the hibernate generator creates Abstract<Table> and <Table> classes as in AbstractItems, Items. All the properties and setters/getters are in the AbstractItems class.

    It seems to me that the Abstract class would be very useful in creating the form beans. Was this the purpose? Just how would you go about using that class in your form beans class?

    Lee

    #214973

    Riyad Kalla
    Member

    Lee, I’ve asked our hibernate dev to take a look at this.

    #214978

    Thanks, but can you explain what the thinking was to separate the <table> class into <abstractTable> and <table> classes to begin with?

    Lee

    #215012

    support-jeff
    Member

    The purpose of creating the abstract and subclasses is to make regeneration of mappings and classes from database easier to deal with – as the javadocs in the classes state, you can do whatever you want to the subclass as it will only be generated once; but the abstract base class will get regen’d if you ever export from the db again, so anything you change there will be lost.

    Personally, I would never directly use a persistent-capable class as a form bean. I would use a form bean class that has two methods that deal with the persistent class – one that populates itself (the form) from an instance of the persistent class, and a second that either populates an instance or creates a new instance of the class populated from the form.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate Wizard, Abstract Class use for Form Beans

You must be logged in to post in the forum log in