Skip to content

Commit

Permalink
nhibernateGH-3530: Rearrange mappings to and remove the schema-action…
Browse files Browse the repository at this point in the history
… attributes.

The SchemaExporter only creates the schema for a table based on the mapping
for the first class it is provided. Subsequent mappings will not affect the
schema generated.
  • Loading branch information
David Ellingsworth authored and David Ellingsworth committed May 15, 2024
1 parent cc1da41 commit c2327c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/NHibernate.Test/NHSpecificTest/GH3530/Mappings.hbm.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test"
namespace="NHibernate.Test.NHSpecificTest.GH3530">
<!-- The schema exporter should ignore this version but we should be able to map it to the version created below. -->
<class name="LocaleEntity" schema-action="validate" table="LocaleEntity">
<!-- The schema exporter only exports the schema of the first class for a table. -->
<class name="SchemaLocaleEntity" table="LocaleEntity">
<id name="Id" generator="guid.comb" />
<property name="IntegerValue" column="IntegerValue"/>
<property name="DateTimeValue" column="DateTimeValue"/>
<property name="DoubleValue" column="DoubleValue"/>
<property name="DecimalValue" column="DecimalValue"/>
</class>
<!-- The schema exporter should export this version of the entity and generate text columns for all types. -->
<class name="SchemaLocaleEntity" table="LocaleEntity" schema-action="export">
<!-- The schema exporter will ignore this because the above class already creates the table. -->
<class name="LocaleEntity" table="LocaleEntity">
<id name="Id" generator="guid.comb" />
<property name="IntegerValue" column="IntegerValue"/>
<property name="DateTimeValue" column="DateTimeValue"/>
Expand Down

0 comments on commit c2327c8

Please sign in to comment.