<selectKey order="BEFORE" resultType="Long" keyProperty="id">
select projects_seq.NEXTVAL from DUAL
</selectKey>
-
insert into projects
(id, name, long_name, description, scope, qualifier, kee, language, root_id, copy_resource_id, person_id, profile_id, enabled)
values (
public void insertOrUpdate() {
setupData("insertOrUpdate");
- // update because already persisted
+ // to be updated
ResourceDto project = new ResourceDto()
.setKey("org.struts:struts").setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT)
.setName("Struts").setLongName("Apache Struts").setLanguage("java").setDescription("MVC Framework")
- .setId(1L);
+ .setId(100L);
- // insert
+ // to be inserted
ResourceDto file1 = new ResourceDto()
.setKey("org.struts:struts:org.struts.Action").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE)
.setLanguage("java").setName("Action").setLongName("org.struts.Action");
assertThat(project.getId()).isNotNull();
assertThat(file1.getId()).isNotNull();
assertThat(file2.getId()).isNotNull();
- checkTables("insertOrUpdate", "projects");
+ checkTables("insertOrUpdate", new String[]{"id"}, "projects");
}
}
<dataset>
- <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
+ <projects root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
description="MVC Framework" long_name="Apache Struts"
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
- <projects id="2" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Action" name="Action"
+ <projects root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Action" name="Action"
description="[null]" long_name="org.struts.Action"
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
- <projects id="3" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Filter" name="Filter"
+ <projects root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Filter" name="Filter"
description="[null]" long_name="org.struts.Filter"
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
<dataset>
- <projects id="1" root_id="200" scope="PRJ" qualifier="TRK" kee="old key" name="old name"
+ <projects id="100" root_id="200" scope="PRJ" qualifier="TRK" kee="old key" name="old name"
description="old name" long_name="old long name"
enabled="[false]" language="old" copy_resource_id="2" person_id="3" profile_id="4"/>