Fixed NPE when using nested classes in entities with @EmbeddedId/@Embeddable
authorKai Moritz <kai@juplo.de>
Sat, 31 Aug 2013 06:51:03 +0000 (08:51 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 31 Aug 2013 06:52:48 +0000 (08:52 +0200)
commitda0b3041b8fbcba6175d05a2561b38c365111ed8
tree109fb1a6d22355ddeccab28ddd0a10893bf32d2b
parent64a648ba88d45cde636cacbc142807dabc77c87d
Fixed NPE when using nested classes in entities with @EmbeddedId/@Embeddable

Patch supplied by Eduard Szente <eduard.szente@gmail.com>

Details:
----------------
Hi,

when using your plugin for schema export the presence of nested classes
in entities (e.g. when using @EmbeddedId/@Embeddable and defining the Id
within the target entity class)
yields to NPEs.

public class Entity {

  @EmbeddedId
  private Id id;

  @Embeddable
  public static class Id implements Serializable {
    ....
  }

}

Entity.Id.class.getSimplename == "Id", while the compiled class is named
"Entity$Id.class"

Patch appended.

Best regards,
Eduard
pom.xml
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java