facebook

MyEclipse 4.0 GA & bug in "Create hibernate mapping

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #236471 Reply

    wildsoul
    Member

    Hello,

    I created a simple table “User” and used the “Create hibernate mapping” option. A few seconds later I had two classes:

    public abstract class AbstractUser
    extends User
    implements Serializable {…}

    public class User
    extends AbstractUser
    implements Serializable {…}

    In another few seconds MyEclispse showed me: “Out of memory”.

    As you can see there is circular reference, and I suppose that this is the source of the problems. (Another thing, less important is redundant “implements Serializable” in the User class.)

    Greetings.

    #236486 Reply

    Riyad Kalla
    Member

    Please provide your Eclipse Build ID (Help > About), also your MyEclipse full Version from Window > Preferences > MyEclipse and also the table schemas for your DB.

    #236495 Reply

    wildsoul
    Member

    Eclipse Build ID: I20050627-1435
    MyEclipse ID: 20050829-4.0.0-GA

    Schemas doesn’t matter at all.

    I made a fastfix by myself.

    A bug is in the template:
    [MyEclipse-install-dir]\eclipse\plugins\com.genuitec.eclipse.hibernate_4.0.0\templates\mappedobject.vm

    Maybe some important issue is, why MyEclipse crashed… but maybe it’s fault of the Eclipse, not your plug-ins.

    I have also request about proper camel-case atrib. names, but I put it in the “Hibernate code generation preferences” topic.

    Greetings.

    #236503 Reply

    Riyad Kalla
    Member

    Can you please post what you had to change in order to fix the issue? I’d like to send it back to the DB team to evaluate.

    #236592 Reply

    wildsoul
    Member

    Sure…

    But it’s a fastfix (it’s work for me), but it’s not a final solution.

    *** mappedobject.vm.org Mon Sep  5 09:08:50 2005
    --- mappedobject.vm     Mon Sep  5 09:08:50 2005
    ***************
    *** 17,28 ****
       * by MyEclipse Hibernate tool integration.
       */
      public abstract class $!{mappedObject.AbstractClassName}
    - #if ($mappedObject.isSubClass())
    -     extends ${mappedObject.SuperClassName}
          implements Serializable
    - #else
    -     implements Serializable
    - #end
      {
      #if ($mappedObject.hasPrimaryKey())
          /** The cached hash code value for this instance.  Settting to 0 triggers re-calculation. */
    --- 17,23 ----

    And if you don’t like redundant “implements Serializable” (I don’t)

    *** mappedobjectsub.vm.org      Mon Sep  5 09:08:50 2005
    --- mappedobjectsub.vm  Mon Sep  5 09:08:50 2005
    ***************
    *** 5,11 ****
      package $!{mappedObject.PackageName};
    
      #end
    - import java.io.Serializable;
    
      /**
       * A class that represents a row in the '${mappedObject.TableName}' table.
    --- 5,10 ----
    ***************
    *** 14,20 ****
       */
      public class ${mappedObject.ClassName}
          extends ${mappedObject.AbstractClassName}
    -     implements Serializable
      {
          /**
           * Simple constructor of ${mappedObject.ClassName} instances.
    --- 13,18 ----

    Greetings.

    #239470 Reply

    Hi,

    Just wanted to mention that this problem is still present in 4.0.2 GA version.
    It is good that I can fix it myself but please fix it in next versions.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: MyEclipse 4.0 GA & bug in "Create hibernate mapping

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