Skip to content

Commit 3edd4bf

Browse files
committed
CAY-2901 Loosing comments on the existing ObjAttribute after DB import
1 parent c264397 commit 3edd4bf

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ CAY-2896 Inserting two identical objects into two datamaps stores both objects i
3434
CAY-2898 Crypto: NPE in a ColumnQuery
3535
CAY-2899 CommitLog: missing lifecycle-induced changes in `excludeFromTransaction` mode
3636
CAY-2900 Meaningful generated PKs could lead to the ClassCastException
37+
CAY-2901 Loosing comments on the existing ObjAttribute after DB import
3738

3839
----------------------------------
3940
Release: 5.0-M1

cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportModule.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import org.apache.cayenne.project.ProjectModule;
3535
import org.apache.cayenne.project.ProjectSaver;
3636
import org.apache.cayenne.project.extension.ExtensionAwareHandlerFactory;
37+
import org.apache.cayenne.project.extension.info.InfoExtension;
38+
import org.apache.cayenne.project.extension.info.InfoExtension;
3739

3840
/**
3941
* A DI module that bootstraps {@link DbImportAction}.
@@ -53,7 +55,9 @@ public void configure(Binder binder) {
5355
binder.bind(DataChannelMetaData.class).to(DefaultDataChannelMetaData.class);
5456
binder.bind(HandlerFactory.class).to(ExtensionAwareHandlerFactory.class);
5557

56-
ProjectModule.extend(binder).addExtension(DbImportExtension.class);
58+
ProjectModule.extend(binder)
59+
.addExtension(DbImportExtension.class)
60+
.addExtension(InfoExtension.class);
5761
}
5862

5963
}

maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
</db-entity>
3030
<obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
3131
<obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
32+
<info:property xmlns:info="http://cayenne.apache.org/schema/10/info" name="comment" value="test"/>
3233
</obj-entity>
3334
</data-map>

maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings.map.xml-result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
<obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
3232
<obj-attribute name="col2" type="java.lang.String" db-attribute-path="COL2"/>
3333
<obj-attribute name="col4" type="java.lang.String" db-attribute-path="COL4"/>
34+
<info:property xmlns:info="http://cayenne.apache.org/schema/10/info" name="comment" value="test"/>
3435
</obj-entity>
3536
</data-map>

0 commit comments

Comments
 (0)