Hibernate SVN: r10396 - trunk/Hibernate3/test/org/hibernate/test/propertyref
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 09:48:02 -0400 (Fri, 01 Sep 2006)
New Revision: 10396
Modified:
trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.hbm.xml
trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.java
trunk/Hibernate3/test/org/hibernate/test/propertyref/PropertyRefTest.java
Log:
added test of simple bag keyed via property-ref
Modified: trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.hbm.xml
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.hbm.xml 2006-09-01 13:41:58 UTC (rev 10395)
+++ trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.hbm.xml 2006-09-01 13:48:02 UTC (rev 10396)
@@ -21,40 +21,35 @@
<hibernate-mapping package="org.hibernate.test.propertyref">
<class name="Person">
-
<id name="id">
<generator class="hilo"/>
</id>
-
+
<property name="name" length="100"/>
-
- <one-to-one name="address"
- property-ref="person"
- cascade="all"
- fetch="join"/>
-
- <set name="accounts"
- inverse="true">
- <key column="userId"
- property-ref="userId"/>
+ <property name="userId" column="person_userid" length="8" unique="true"/>
+
+ <one-to-one name="address" property-ref="person" cascade="all" fetch="join"/>
+
+ <set name="accounts" inverse="true">
+ <key column="userId" property-ref="userId"/>
<one-to-many class="Account"/>
</set>
-
- <property name="userId" column="person_userid" length="8" unique="true"/>
-
- </class>
+ <bag name="systems" table="USER_SYSTEM" lazy="false" inverse="false" cascade="all">
+ <key column="USER_ID" property-ref="userId" />
+ <element type="string" column="SYSTEM" />
+ </bag>
+ </class>
+
<class name="Address">
-
<id name="id">
<generator class="hilo"/>
</id>
-
+
<property name="address" length="300"/>
<property name="zip" length="5"/>
<property name="country" length="25"/>
<many-to-one name="person" unique="true" not-null="true"/>
-
</class>
<class name="Account">
Modified: trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.java 2006-09-01 13:41:58 UTC (rev 10395)
+++ trunk/Hibernate3/test/org/hibernate/test/propertyref/Person.java 2006-09-01 13:48:02 UTC (rev 10396)
@@ -3,6 +3,8 @@
import java.util.HashSet;
import java.util.Set;
+import java.util.List;
+import java.util.ArrayList;
/**
* @author gavin
@@ -13,6 +15,8 @@
private Address address;
private String userId;
private Set accounts = new HashSet();
+ private List systems = new ArrayList();
+
/**
* @return Returns the userId.
*/
@@ -73,4 +77,12 @@
public void setAccounts(Set accounts) {
this.accounts = accounts;
}
+
+ public List getSystems() {
+ return systems;
+ }
+
+ public void setSystems(List systems) {
+ this.systems = systems;
+ }
}
Modified: trunk/Hibernate3/test/org/hibernate/test/propertyref/PropertyRefTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/propertyref/PropertyRefTest.java 2006-09-01 13:41:58 UTC (rev 10395)
+++ trunk/Hibernate3/test/org/hibernate/test/propertyref/PropertyRefTest.java 2006-09-01 13:48:02 UTC (rev 10396)
@@ -26,7 +26,40 @@
public PropertyRefTest(String str) {
super(str);
}
-
+
+ public void testNonLazyBagKeyPropertyRef() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+ Person p = new Person();
+ p.setName( "Steve" );
+ p.setUserId( "steve" );
+ p.getSystems().add( "QA" );
+ p.getSystems().add( "R&D" );
+ s.persist( p );
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.createQuery( "from Person" ).list();
+ s.clear();
+ s.createSQLQuery( "select {p.*} from Person {p}" )
+ .addEntity( "p", Person.class.getName() )
+ .list();
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ List results = s.createQuery( "from Person" ).list();
+ Iterator itr = results.iterator();
+ while ( itr.hasNext() ) {
+ s.delete( itr.next() );
+ }
+ t.commit();
+ s.close();
+ }
+
public void testManyToManyPropertyRef() {
// prepare some test data relating to the Group->Person many-to-many association
Session s = openSession();
@@ -228,5 +261,9 @@
cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "1");
cfg.setProperty(Environment.GENERATE_STATISTICS, "true");
}
+
+ public String getCacheConcurrencyStrategy() {
+ return null;
+ }
}
18 years, 3 months
Hibernate SVN: r10395 - in trunk/Hibernate3/test/org/hibernate/test/jpa: . lock ql
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 09:41:58 -0400 (Fri, 01 Sep 2006)
New Revision: 10395
Added:
trunk/Hibernate3/test/org/hibernate/test/jpa/ql/NativeQueryTest.java
Modified:
trunk/Hibernate3/test/org/hibernate/test/jpa/JPAComplianceSuite.java
trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java
Log:
minor JPA-related test enhancements
Modified: trunk/Hibernate3/test/org/hibernate/test/jpa/JPAComplianceSuite.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/jpa/JPAComplianceSuite.java 2006-09-01 12:43:14 UTC (rev 10394)
+++ trunk/Hibernate3/test/org/hibernate/test/jpa/JPAComplianceSuite.java 2006-09-01 13:41:58 UTC (rev 10395)
@@ -8,6 +8,7 @@
import org.hibernate.test.jpa.proxy.JPAProxyTest;
import org.hibernate.test.jpa.fetch.FetchingTest;
import org.hibernate.test.jpa.ql.JPAQLComplianceTest;
+import org.hibernate.test.jpa.ql.NativeQueryTest;
/**
* @author Steve Ebersole
@@ -20,6 +21,7 @@
suite.addTest( JPAProxyTest.suite() );
suite.addTest( FetchingTest.suite() );
suite.addTest( JPAQLComplianceTest.suite() );
+ suite.addTest( NativeQueryTest.suite() );
suite.addTest( RemovedEntityTest.suite() );
return suite;
}
Modified: trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java 2006-09-01 12:43:14 UTC (rev 10394)
+++ trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java 2006-09-01 13:41:58 UTC (rev 10395)
@@ -4,6 +4,8 @@
import org.hibernate.Transaction;
import org.hibernate.LockMode;
import org.hibernate.StaleObjectStateException;
+import org.hibernate.exception.SQLGrammarException;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.test.jpa.AbstractJPATest;
import org.hibernate.test.jpa.Item;
import org.hibernate.test.jpa.Part;
@@ -65,7 +67,12 @@
assertEquals( "encountered non-repeatable read", check, item2.getName() );
assertEquals( "encountered non-repeatable read", initialVersion, item2.getVersion() );
+ t1.commit();
+ s1.close();
+
// clean up
+ s1 = getSessions().openSession();
+ t1 = s1.beginTransaction();
s1.createQuery( "delete Item" ).executeUpdate();
t1.commit();
s1.close();
@@ -117,8 +124,25 @@
catch( StaleObjectStateException expected ) {
// this is the expected behavior
}
+ catch( SQLGrammarException t ) {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ // sql-server (using snapshot isolation) reports this as a grammar exception /:)
+ //
+ // not to mention that it seems to "lose track" of the transaction in this scenario...
+ t1.rollback();
+ t1 = s1.beginTransaction();
+ }
+ else {
+ throw t;
+ }
+ }
+ t1.commit();
+ s1.close();
+
// clean up
+ s1 = getSessions().openSession();
+ t1 = s1.beginTransaction();
s1.createQuery( "delete Item" ).executeUpdate();
t1.commit();
s1.close();
@@ -159,7 +183,12 @@
assertTrue( part == part2 );
assertEquals( "encountered non-repeatable read", check, part2.getName() );
+ t1.commit();
+ s1.close();
+
// clean up
+ s1 = getSessions().openSession();
+ t1 = s1.beginTransaction();
s1.delete( part );
t1.commit();
s1.close();
Added: trunk/Hibernate3/test/org/hibernate/test/jpa/ql/NativeQueryTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/jpa/ql/NativeQueryTest.java 2006-09-01 12:43:14 UTC (rev 10394)
+++ trunk/Hibernate3/test/org/hibernate/test/jpa/ql/NativeQueryTest.java 2006-09-01 13:41:58 UTC (rev 10395)
@@ -0,0 +1,29 @@
+package org.hibernate.test.jpa.ql;
+
+import org.hibernate.test.jpa.AbstractJPATest;
+import org.hibernate.Session;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * todo: describe NativeQueryTest
+ *
+ * @author Steve Ebersole
+ */
+public class NativeQueryTest extends AbstractJPATest {
+ public NativeQueryTest(String name) {
+ super( name );
+ }
+
+ public static Test suite() {
+ return new TestSuite( NativeQueryTest.class );
+ }
+
+ public void testJpaStylePositionalParametersInNativeSql() {
+ Session s = openSession();
+ s.beginTransaction();
+ s.createSQLQuery( "select NAME from EJB3_ITEM where ITEM_ID = ?1" ).setParameter( "1", "123" ).list();
+ s.getTransaction().commit();
+ s.close();
+ }
+}
18 years, 3 months
Hibernate SVN: r10394 - trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2006-09-01 08:43:14 -0400 (Fri, 01 Sep 2006)
New Revision: 10394
Modified:
trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/ExporterTask.java
Log:
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/ExporterTask.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/ExporterTask.java 2006-09-01 12:42:49 UTC (rev 10393)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/ExporterTask.java 2006-09-01 12:43:14 UTC (rev 10394)
@@ -96,8 +96,7 @@
exporter.setProperties(prop);
exporter.setConfiguration( parent.getConfiguration() );
exporter.setOutputDirectory( getDestdir() );
- exporter.setTemplatePath( getTemplatePath().list() );
- if(templatePrefix!=null) exporter.setTemplatePrefix(templatePrefix);
+ exporter.setTemplatePath( getTemplatePath().list() );
return exporter;
}
}
18 years, 3 months
Hibernate SVN: r10393 - trunk/Hibernate3/src/org/hibernate/event/def
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 08:42:49 -0400 (Fri, 01 Sep 2006)
New Revision: 10393
Modified:
trunk/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java
Log:
HHH-2044 : minor exception creation issue
Modified: trunk/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java 2006-09-01 12:40:52 UTC (rev 10392)
+++ trunk/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java 2006-09-01 12:42:49 UTC (rev 10393)
@@ -260,7 +260,7 @@
source.getFactory().getStatisticsImplementor()
.optimisticFailure( entityName );
}
- throw new StaleObjectStateException( entityName, event.getRequestedId() );
+ throw new StaleObjectStateException( entityName, id );
}
// cascade first, so that all unsaved objects get their
18 years, 3 months
Hibernate SVN: r10392 - branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 08:40:52 -0400 (Fri, 01 Sep 2006)
New Revision: 10392
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java
Log:
HHH-2044 : minor exception creation issue
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java 2006-09-01 12:38:14 UTC (rev 10391)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/DefaultMergeEventListener.java 2006-09-01 12:40:52 UTC (rev 10392)
@@ -258,7 +258,7 @@
source.getFactory().getStatisticsImplementor()
.optimisticFailure( entityName );
}
- throw new StaleObjectStateException( entityName, event.getRequestedId() );
+ throw new StaleObjectStateException( entityName, id );
}
// cascade first, so that all unsaved objects get their
18 years, 3 months
Hibernate SVN: r10391 - in trunk/HibernateExt/tools/src: java/org/hibernate/tool/hbm2x java/org/hibernate/tool/hbm2x/seam test/org/hibernate/tool test/org/hibernate/tool/hbm2x test/org/hibernate/tool/test/jdbc2cfg testsupport
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2006-09-01 08:38:14 -0400 (Fri, 01 Sep 2006)
New Revision: 10391
Removed:
trunk/HibernateExt/tools/src/test/org/hibernate/tool/test/jdbc2cfg/newformat.reveng.xml
Modified:
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/AbstractExporter.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DAOExporter.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/Exporter.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/HibernateMappingExporter.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/POJOExporter.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/TemplateHelper.java
trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/seam/SeamExporter.java
trunk/HibernateExt/tools/src/test/org/hibernate/tool/BaseTestCase.java
trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java
trunk/HibernateExt/tools/src/testsupport/anttest-build.xml
Log:
HBX-742 remove Exporter.setTemplatePrefix
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/AbstractExporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/AbstractExporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/AbstractExporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -36,8 +36,6 @@
private Cfg2HbmTool c2h;
private Cfg2JavaTool c2j;
- private String templatePrefix = null;
-
public AbstractExporter(Configuration cfg, File outputdir) {
this();
setConfiguration(cfg);
@@ -133,18 +131,11 @@
protected void setupTemplates() {
if(log.isDebugEnabled()) {
- log.debug(getClass().getName() + " outputdir:" + getOutputDirectory() + " templatePrefix: " + getTemplatePrefix() + " path: " + toString(templatePaths) );
+ log.debug(getClass().getName() + " outputdir:" + getOutputDirectory() + " path: " + toString(templatePaths) );
}
- getTemplateHelper().init(getOutputDirectory(), getTemplatePrefix(), templatePaths);
+ getTemplateHelper().init(getOutputDirectory(), templatePaths);
}
- final public String getTemplatePrefix() {
- return templatePrefix ; // default to not have any prefix
- }
-
- public void setTemplatePrefix(String t) {
- this.templatePrefix = t;
- }
/**
* Setup the context variables used by the exporter. Subclasses should call super.setupContext() to ensure all needed variables are in the context.
**/
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DAOExporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DAOExporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DAOExporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -8,7 +8,7 @@
public class DAOExporter extends POJOExporter {
- private static final String DAO_DAOHOME_VM = "daohome.ftl";
+ private static final String DAO_DAOHOME_FTL = "dao/daohome.ftl";
private String sessionFactoryName = "SessionFactory";
@@ -21,9 +21,8 @@
protected void init() {
super.init();
- setTemplateName(DAO_DAOHOME_VM);
- setFilePattern("{package-name}/{class-name}Home.java");
- setTemplatePrefix("dao/");
+ setTemplateName(DAO_DAOHOME_FTL);
+ setFilePattern("{package-name}/{class-name}Home.java");
}
protected void exportComponent(Map additionalContext, POJOClass element) {
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/Exporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/Exporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/Exporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -32,7 +32,7 @@
/**
* @param templatePrefix template prefix to be used. e.g. if set to "dao/", "dao/" will be prefixed all lookups before the simple name will looked up. Used to allow seperation of templates within a templatepath.
*/
- public void setTemplatePrefix(String templatePrefix);
+// public void setTemplatePrefix(String templatePrefix);
/**
*
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/HibernateMappingExporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/HibernateMappingExporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/HibernateMappingExporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -39,7 +39,7 @@
Configuration cfg = getConfiguration();
if(c2h.isImportData(cfg) && (c2h.isNamedQueries(cfg)) && (c2h.isNamedSQLQueries(cfg)) && (c2h.isFilterDefinitions(cfg))) {
TemplateProducer producer = new TemplateProducer(getTemplateHelper(),getArtifactCollector());
- producer.produce(new HashMap(), "generalhbm.hbm.ftl", new File(getOutputDirectory(),"GeneralHbmSettings.hbm.xml"), getTemplateName());
+ producer.produce(new HashMap(), "hbm/generalhbm.hbm.ftl", new File(getOutputDirectory(),"GeneralHbmSettings.hbm.xml"), getTemplateName());
}
}
@@ -49,9 +49,8 @@
}
protected void init() {
- setTemplateName("hibernate-mapping.hbm");
- setFilePattern("{package-name}/{class-name}.hbm.xml");
- setTemplatePrefix("hbm/");
+ setTemplateName("hbm/hibernate-mapping.hbm.ftl");
+ setFilePattern("{package-name}/{class-name}.hbm.xml");
}
public HibernateMappingExporter() {
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/POJOExporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/POJOExporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/POJOExporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -13,7 +13,7 @@
*/
public class POJOExporter extends GenericExporter {
- private static final String POJO_JAVACLASS_VM = "Pojo";
+ private static final String POJO_JAVACLASS_FTL = "pojo/Pojo.ftl";
public POJOExporter(Configuration cfg, File outputdir) {
super(cfg, outputdir);
@@ -21,9 +21,8 @@
}
protected void init() {
- setTemplateName(POJO_JAVACLASS_VM);
- setFilePattern("{package-name}/{class-name}.java");
- setTemplatePrefix("pojo/");
+ setTemplateName(POJO_JAVACLASS_FTL);
+ setFilePattern("{package-name}/{class-name}.java");
}
public POJOExporter() {
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/TemplateHelper.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/TemplateHelper.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/TemplateHelper.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -57,9 +57,8 @@
}
- public void init(File outputDirectory, String templatePrefix, String[] templatePaths) {
+ public void init(File outputDirectory, String[] templatePaths) {
this.outputDirectory = outputDirectory;
- this.templatePrefix = templatePrefix;
context = new SimpleHash(ObjectWrapper.BEANS_WRAPPER);
freeMarkerEngine = new Configuration();
@@ -241,7 +240,7 @@
/** look up the template named templateName via the paths and print the content to the output */
public void processTemplate(String templateName, Writer output) {
try {
- Template template = freeMarkerEngine.getTemplate(getTemplateName(templateName));
+ Template template = freeMarkerEngine.getTemplate(templateName);
template.process(getContext(), output);
}
catch (IOException e) {
@@ -254,6 +253,7 @@
throw new ExporterException("Error while processing template " + templateName, e);
}
}
+
/**
* Check if the template exists. Tries to search with the templatePrefix first and then secondly without the template prefix.
@@ -261,7 +261,7 @@
* @param name
* @return
*/
- protected String getTemplateName(String name) {
+ /*protected String getTemplateName(String name) {
if(!name.endsWith(".ftl")) {
name = name + ".ftl";
}
@@ -275,7 +275,7 @@
}
throw new ExporterException("Could not find template with name: " + name);
- }
+ }*/
public boolean templateExists(String templateName) {
TemplateLoader templateLoader = freeMarkerEngine.getTemplateLoader();
Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/seam/SeamExporter.java
===================================================================
--- trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/seam/SeamExporter.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/seam/SeamExporter.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -21,7 +21,7 @@
}
private void init() {
- setTemplatePrefix("seam/");
+
}
protected void setupContext() {
Modified: trunk/HibernateExt/tools/src/test/org/hibernate/tool/BaseTestCase.java
===================================================================
--- trunk/HibernateExt/tools/src/test/org/hibernate/tool/BaseTestCase.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/BaseTestCase.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -45,7 +45,7 @@
if (getOutputDir()!=null) TestHelper.deleteDir(getOutputDir());
//assertEquals("Method not found errors during template processing:\n " + HibernateUberspect.getMethodErrors(),0,HibernateUberspect.getMethodNotFoundCount());
- assertNoTables();
+ // assertNoTables();
}
Modified: trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java
===================================================================
--- trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java 2006-09-01 12:38:14 UTC (rev 10391)
@@ -32,7 +32,7 @@
GenericExporter ge = new GenericExporter();
ge.setConfiguration(getCfg());
ge.setOutputDirectory(getOutputDir());
- ge.setTemplateName("generictemplates/pojo/generic-test");
+ ge.setTemplateName("generictemplates/pojo/generic-test.ftl");
ge.setFilePattern("generictest.txt");
ge.start();
@@ -64,7 +64,7 @@
GenericExporter ge = new GenericExporter();
ge.setConfiguration(getCfg());
ge.setOutputDirectory(getOutputDir());
- ge.setTemplateName("generictemplates/pojo/generic-class");
+ ge.setTemplateName("generictemplates/pojo/generic-class.ftl");
ge.setFilePattern("generic{class-name}.txt");
ge.start();
@@ -80,7 +80,7 @@
GenericExporter ge = new GenericExporter();
ge.setConfiguration(getCfg());
ge.setOutputDirectory(getOutputDir());
- ge.setTemplateName("generictemplates/pojo/generic-class");
+ ge.setTemplateName("generictemplates/pojo/generic-class.ftl");
ge.setFilePattern("{package-name}/generic{class-name}.txt");
ge.start();
@@ -109,7 +109,7 @@
p.setProperty("hibernatetool.booleanProperty", "true");
p.setProperty("hibernatetool.myTool.toolclass", "org.hibernate.tool.hbm2x.Cfg2JavaTool");
ge.setProperties(p);
- ge.setTemplateName("generictemplates/pojo/generic-class");
+ ge.setTemplateName("generictemplates/pojo/generic-class.ftl");
ge.setFilePattern("{package-name}/generic{class-name}.txt");
ge.start();
Deleted: trunk/HibernateExt/tools/src/test/org/hibernate/tool/test/jdbc2cfg/newformat.reveng.xml
===================================================================
--- trunk/HibernateExt/tools/src/test/org/hibernate/tool/test/jdbc2cfg/newformat.reveng.xml 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/test/jdbc2cfg/newformat.reveng.xml 2006-09-01 12:38:14 UTC (rev 10391)
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
-
-<hibernate-reverse-engineering case-match="exact|upper|lower">
-
- <!-- .* is valid, will be translated into % -->
- <database-selection match-catalog="PUBLIC.*" match-schema="OVRTEST" match-table=".*"/>
-
- <type-mapping>
- <from-sql-type native-type="varchar" jdbc-type="VARCHAR" length='20'>
- <hibernate-type name="SomeUserType"><param></param></hibernate-type>
- </from-sql-type>
- </type-mapping>
-
- <table-filter match-schema=".*" match-name="TBL_.*">
- <entity package="org.werd"/>
- </table-filter>
-
-
- <table-filter match-name="DEFUNCT_TABLE" exclude="true" />
- <table-filter match-name="DoNotWantIt" exclude="true" />
- <table-filter match-name="WantedTable" />
- <table-filter match-catalog="BAD" match-schema="SCHEMA"
- match-name=".*" exclude="true" />
-
- <table-filter match-catalog=".*" match-schema=".*"
- match-name="BIN$.*" exclude="true" />
-
- <table-filter match-name=".*" exclude="false"/>
- <!--
- <table name="CUSTOMER" package="org.funk" class-name="MyCustomer">
- <column name="order" property-name="orderName" />
- </table>
-
- <table name="CUSTOMER">
- <column name="ORDER" />
- </table>
-
- <table catalog="CUSTOMER" schema="WHATEVER" name="ORDER">
- <column name="name" exclude="true">
- <meta attribute="property-name">Name</meta>
- </column>
- </table>
- -->
-
-<!-- hack for disable many-to-many
- <table name="CategoryItem">
- <foreign-key constraint-name="CAT_FK" foreign-table="CATEGORY" >
- <column-ref local-column="catid" foreign-column="id" />
- <many-to-one name="dfdf"/>
- </foreign-key>
- </table>
--->
- <!--
- alter table Customer add constraint 'max' foreign key (addressid, x) references address (dfdf)
-
- default_schema PUBLIC
- -->
- <table name="ORDERS" class="Order">
- <primary-key property="id" key-class="OrderId">
- <generator class="sequence">
- <param name="table">seq_table</param>
- </generator>
- <key-column name="CUSTID1" property="val1" type="string"/> <!-- no exclude -->
- <key-column name="CUSTID2" />
- <key-column name="CUSTID3" />
- </primary-key>
-
- <column name="generated" exclude="true" property="price"/>
-
- <for-columns exclude="false" property="price" type="MonetaryAmount">
- <column name="PRICE"/>
- <column name="CURRENCY"/>
- </for-columns>
-
- <!-- if constraint-name exist in db, use it! ignore foreign-x -->
- <foreign-key constraint-name="SYS_CP20" foreign-table="PARENT" >
- <column-ref local-column="parentid" foreign-column="id" />
- <column-ref local-column="extraparentid" foreign-column="extraid" />
- <many-to-one property="order"/>
- <set name="orders"/>
- </foreign-key>
-
-
- <foreign-key constraint-name="SYS_CP20" foreign-table="PARENT" >
- <column-ref local-column="parentid" foreign-column="id" />
- <column-ref local-column="extraparentid" foreign-column="extraid" />
- <many-to-one property="order"/>
- <map name="orders">
- <map-key column="xxx"/>
- </map>
- </foreign-key>
-
- <foreign-key foreign-table="PARENT">
- <column-ref local-column="parentid" foreign-column="id" />
- <column-ref local-column="extraparentid" foreign-column="extraid" />
- </foreign-key>
-
-
- bidirectionality
- cardinality
-
- entity-name
- collection-name
-
- <many-to-one ...>
- <
-
-
- </table>
-
-
- <table name="CHILDREN">
- <foreign-key foreign-table="PARENT">
- <column-ref local-column="parentid" foreign-column="id" />
- <column-ref local-column="extraparentid"
- foreign-column="extraid" />
- </foreign-key>
- </table>
-
- <table name="EXCOLUMNS">
- <column name="EXCOLUMN" exclude="true"/>
- </table>
-
- <table name="TblTest" class="org.test.Test"/>
-
-
-</hibernate-reverse-engineering>
\ No newline at end of file
Modified: trunk/HibernateExt/tools/src/testsupport/anttest-build.xml
===================================================================
--- trunk/HibernateExt/tools/src/testsupport/anttest-build.xml 2006-08-31 19:57:04 UTC (rev 10390)
+++ trunk/HibernateExt/tools/src/testsupport/anttest-build.xml 2006-09-01 12:38:14 UTC (rev 10391)
@@ -210,7 +210,7 @@
<copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
<hibernatetool destdir="${build.dir}">
- <jpaconfiguration configurationfile="blah"/>
+ <jpaconfiguration/>
<classpath>
<path location="${build.dir}/ejb3/classes" />
</classpath>
18 years, 3 months