Author: vyemialyanchyk
Date: 2010-09-02 11:30:36 -0400 (Thu, 02 Sep 2010)
New Revision: 24666
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
Log:
https://jira.jboss.org/browse/JBIDE-6722 &
https://jira.jboss.org/browse/JBIDE-6951 -
fix for the trunk and jbosstools-3.2.0.M2 branch
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -1,55 +1,55 @@
-<ant-tasks>
- <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- </task>
- <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- <attribute name="ejb3" gui-name="ejb3"
default="false"/>
- </task>
- <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- </task>
- <task name="hbmtemplate"
id="org.hibernate.tools.hbmtemplate">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- <attribute name="filepattern" gui-name="file_pattern"
default=""/>
- <attribute name="foreach" gui-name="for_each"
default=""/>
- <attribute name="template" gui-name="template_name"
default=""/>
- <attribute name="exporterclass" gui-name="exporterclass"
default=""/>
- </task>
- <task name="hbm2java" id="org.hibernate.tools.hbm2java">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- <attribute name="jdk5" gui-name="jdk5"
default="false"/>
- <attribute name="ejb3" gui-name="ejb3"
default="false"/>
- </task>
- <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- <attribute name="export" gui-name="exportToDatabase"
default="true"/>
- <attribute name="update" gui-name="schemaUpdate"
default="false"/>
- <attribute name="drop" gui-name="drop"
default="false"/>
- <attribute name="create" gui-name="create"
default="true"/>
- <attribute name="outputfilename" gui-name="outputfilename"
default=""/>
- <attribute name="delimiter" gui-name="delimiter"
default=";"/>
- <attribute name="format" gui-name="format"
default="false"/>
- <attribute name="haltonerror" gui-name="haltonerror"
default="false"/>
- <attribute name="console" gui-name="scriptToConsole"
default="true"/>
- </task>
- <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
- <attribute name="destdir" gui-name="outputdir"
default=""/>
- <attribute name="templatepath" gui-name="template_path"
default=""/>
- <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
- <attribute name="jdk5" gui-name="jdk5"
default="false"/>
- <attribute name="ejb3" gui-name="ejb3"
default="false"/>
- </task>
-</ant-tasks>
\ No newline at end of file
+<ant-tasks>
+ <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ </task>
+ <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ <attribute name="ejb3" gui-name="ejb3"
default="false"/>
+ </task>
+ <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ </task>
+ <task name="hbmtemplate"
id="org.hibernate.tools.hbmtemplate">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ <attribute name="filepattern" gui-name="file_pattern"
default=""/>
+ <attribute name="foreach" gui-name="for_each"
default=""/>
+ <attribute name="template" gui-name="template_name"
default=""/>
+ <attribute name="exporterclass" gui-name="exporterclass"
default=""/>
+ </task>
+ <task name="hbm2java" id="org.hibernate.tools.hbm2java">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ <attribute name="jdk5" gui-name="jdk5"
default="false"/>
+ <attribute name="ejb3" gui-name="ejb3"
default="false"/>
+ </task>
+ <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ <attribute name="export" gui-name="exportToDatabase"
default="true"/>
+ <attribute name="update" gui-name="schemaUpdate"
default="false"/>
+ <attribute name="drop" gui-name="drop"
default="false"/>
+ <attribute name="create" gui-name="create"
default="true"/>
+ <attribute name="outputfilename" gui-name="outputfilename"
default=""/>
+ <attribute name="delimiter" gui-name="delimiter"
default=";"/>
+ <attribute name="format" gui-name="format"
default="false"/>
+ <attribute name="haltonerror" gui-name="haltonerror"
default="false"/>
+ <attribute name="console" gui-name="scriptToConsole"
default="true"/>
+ </task>
+ <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
+ <attribute name="destdir" gui-name="outputdir"
default=""/>
+ <attribute name="templatepath" gui-name="template_path"
default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix"
default=""/>
+ <attribute name="jdk5" gui-name="jdk5"
default="false"/>
+ <attribute name="ejb3" gui-name="ejb3"
default="false"/>
+ </task>
+</ant-tasks>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-09-02
15:30:36 UTC (rev 24666)
@@ -140,6 +140,10 @@
return definition.getExporterTag();
}
+ public String getExporterDefinitionId() {
+ return definition.getId();
+ }
+
public void setProperties(Map<String, String> props) {
inputProperties.clear();
inputProperties.putAll( props );
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-09-02
15:30:36 UTC (rev 24666)
@@ -316,15 +316,17 @@
}
//Map<String, ExporterProperty> defExpProps =
ef.getDefaultExporterProperties();
//String expId = ef.getId();
+ String expDefId = ef.getExporterDefinitionId();
String expName = ef.getExporterTag();
// mapping: guiName -> AttributeDescription
Map<String, AttributeDescription> attributesDescrGui =
exportersDescr.get(expName);
+ if (attributesDescrGui == null) {
+ attributesDescrGui = new TreeMap<String, AttributeDescription>();
+ }
// construct new mapping: name -> AttributeDescription
Map<String, AttributeDescription> attributesDescrAnt = new TreeMap<String,
AttributeDescription>();
- if(attributesDescrGui!=null) {
- for (AttributeDescription ad : attributesDescrGui.values()) {
- attributesDescrAnt.put(ad.name, ad);
- }
+ for (AttributeDescription ad : attributesDescrGui.values()) {
+ attributesDescrAnt.put(ad.name, ad);
}
//
Element exporter = hibernatetool.addElement(expName);
@@ -334,7 +336,7 @@
//
Properties extractGUISpecial = new Properties();
try {
- ExporterFactory.extractExporterProperties(ef.getId(), expProps, extractGUISpecial);
+ ExporterFactory.extractExporterProperties(expDefId, expProps, extractGUISpecial);
} catch (CoreException e) {
// ignore
}
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -34,7 +34,7 @@
<hbm2java destdir="outputdir/test">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2ddl>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -35,7 +35,7 @@
<hbm2java destdir="outputdir/test" ejb3="true"
jdk5="true">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
</hbm2ddl>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -25,7 +25,7 @@
<hbm2java destdir="outputdir/test">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2ddl>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -26,7 +26,7 @@
<hbm2java destdir="outputdir/test">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2ddl>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -26,7 +26,7 @@
<hbm2java destdir="outputdir/test">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2ddl>
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
---
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-02
15:29:38 UTC (rev 24665)
+++
branches/jbosstools-3.2.0.M2/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-02
15:30:36 UTC (rev 24666)
@@ -28,7 +28,7 @@
<hbm2java destdir="outputdir/test">
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
- <hbm2ddl>
+ <hbm2ddl export="false">
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2ddl>