From 02312592d27d628cc7e0d8e28cc40bf74a80de21 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 31 Jul 2013 23:07:26 +0200 Subject: [PATCH] Added support for mapping-configuration through mapping-files (*.hbm.xml) --- .../juplo/plugins/hibernate4/Hbm2DdlMojo.java | 86 +++++++++++++++++-- 1 file changed, 79 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java index 36a5aca4..044e3307 100644 --- a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java @@ -19,6 +19,7 @@ package de.juplo.plugins.hibernate4; import com.pyx4j.log4j.MavenLogAppender; import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -28,6 +29,7 @@ import java.math.BigInteger; import java.net.URL; import java.net.URLClassLoader; import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; @@ -48,6 +50,7 @@ import java.util.logging.Logger; import javax.persistence.Embeddable; import javax.persistence.Entity; import javax.persistence.MappedSuperclass; +import org.apache.maven.model.Resource; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -202,7 +205,6 @@ public class Hbm2DdlMojo extends AbstractMojo /** * Hibernate Naming Strategy * @parameter property="hibernate.ejb.naming_strategy" - * @author nicus */ private String hibernateNamingStrategy; @@ -213,6 +215,14 @@ public class Hbm2DdlMojo extends AbstractMojo */ private String hibernateProperties; + /** + * List of Hibernate-Mapping-Files (XML). + * Multiple files can be separated with white-spaces and/or commas. + * + * @parameter property="hibernate.mapping" + */ + private String hibernateMapping; + /** * Target of execution: *