3 Replies Latest reply on Mar 8, 2005 2:19 PM by bill.burke

    Fixes/Features?

    deb

      So, in playing around with EJB3Pre4 I found several things that didn't yet work right or weren't implemented yet, and several of them I wanted.

      I can post patches for two bugs (@Serialized fields get type = "seralized" instead of type = "serializable" and @DiscriminatorColumns get emitted after the version column, if it exists, which causes the mapping to fail to validate). Both patches are pretty simple.

      I've also got an implementation of a more complete handling of @Embedded/@Embeddable, including a recursive walk down into nested @Embeddables with @AttributeOverrides; this lets you have complex embeddables and it appears to be doing the right thing for some reasonably complex situations.

      The other thing I did was to toss in a @HibernateColumn annotation which has one field, "type", which lets you explicitly set the type in the generated mapping.

      Would there be interest on the part of the developers in any of these things? I can separate the bugfixes out as patches easily enough. I can probably do the HibernateColumn thing as a standalone patch. The Embeddable support is pretty extensive because it changes the normal walk of classes/properties/etc in order to correctly override things, so it's not really a patch per se.

        • 1. Re: Fixes/Features?
          deb

          In fact, since it's easy enough, here're the bug fixes.

          --- EntityToHibernateXml.java.orig 2005-02-26 15:47:33.809199500 -0700
          +++ EntityToHibernateXml.java 2005-02-26 15:48:52.776091100 -0700
          @@ -555,7 +555,7 @@
           if (p.getAnnotation(Serialized.class) != null)
           {
           ind.indent();
          - writer.println(" type=\"seralized\"");
          + writer.println(" type=\"serializable\"");
           }
           else if (lob != null)
           {
          @@ -595,7 +595,7 @@
           if (p.isAnnotationPresent(Serialized.class))
           {
           ind.indent();
          - writer.println(" type=\"seralized\"");
          + writer.println(" type=\"serializable\"");
           }
           ind.indent();
           writer.print(" access=\"" + p.getDefaultAccess() + "\"");
          @@ -1638,14 +1638,14 @@
           Entity entity = (Entity) clazz.getAnnotation(Entity.class);
           handlePrimaryKey(clazz);
          
          + handleDiscriminatorColumn(clazz, inheritance);
          +
           Property version = getAnnotatedProperty(clazz, Version.class, true);
           if (version != null)
           {
           handleProperty(version);
           }
          
          - handleDiscriminatorColumn(clazz, inheritance);
          -
           HashMap<String, ArrayList<Property>> secondary = new HashMap<String, ArrayList<Property>>();
           iterateProperties(secondary, new HashSet(), clazz, clazz);
          
          


          • 2. Re: Fixes/Features?
            bill.burke

            yes, post it as patch in JIRA.

            • 3. Re: Fixes/Features?
              bill.burke

              fixed and regression tested in HEAD