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
<name>Lorenzo Nicora</name>
<email>lorenzo.nicora@nicus.it</email>
</contributor>
+ <contributor>
+ <name>Eduard Szente</name>
+ <email>eduard.szente@gmail.com</email>
+ </contributor>
</contributors>
<distributionManagement>
{
Class<?> annotatedClass = classLoader.loadClass(name);
classes.add(annotatedClass);
+ String resourceName = annotatedClass.getName();
+ resourceName = resourceName.substring(resourceName.lastIndexOf(".") + 1, resourceName.length()) + ".class";
InputStream is =
annotatedClass
- .getResourceAsStream(annotatedClass.getSimpleName() + ".class");
+ .getResourceAsStream(resourceName);
byte[] buffer = new byte[1024*4]; // copy data in 4MB-chunks
int i;
while((i = is.read(buffer)) > -1)