Skip to content

Commit bc1d354

Browse files
committed
CAY-2901 Loosing comments on the existing ObjAttribute after DB import
1 parent 5584d93 commit bc1d354

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

RELEASE-NOTES.txt

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

3031
----------------------------------
3132
Release: 4.2.2

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
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;
3738

3839
/**
3940
* A DI module that bootstraps {@link DbImportAction}.
@@ -53,6 +54,7 @@ public void configure(Binder binder) {
5354
binder.bind(DataChannelMetaData.class).to(DefaultDataChannelMetaData.class);
5455
binder.bind(HandlerFactory.class).to(ExtensionAwareHandlerFactory.class);
5556
ProjectModule.contributeExtensions(binder).add(DbImportExtension.class);
57+
ProjectModule.contributeExtensions(binder).add(InfoExtension.class);
5658
}
5759

5860
}

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)