Skip to content
Snippets Groups Projects
Commit cde538fd authored by npedot's avatar npedot
Browse files

wip horizontal changeset sakila

parent 6f7bcd6d
Branches
Tags
No related merge requests found
......@@ -85,19 +85,21 @@ class SakilaTransfomerScenarioTI {
@Test
fun test_xpath_horizontal_decomposition_on_person_db() {
/*
// given
val dbFilePath = "db/person.xml"
val trasformerName = "horizontal"
val trasformerDirection = "decompose"
val trasformerVersion = "1"
val dbFilePath = "db/sakila_film_functional.xml"
val transfomerXml = SakilaTransfomerScenarioTI::class.java.getResource("/transformer/sakilaHTransfomer.xml").readText()
val vTransfomer = XMLSerializeUseCase(XMLSerializerJacksonAdapter()).deserializeTransformer(transfomerXml).ok
val templateFilePath = vTransfomer!!.splitter.template.filename
val xrules = toProperties(vTransfomer!!.splitter.xman.xrules)
val tranformerParmeters = mutableMapOf<String,Any>()
tranformerParmeters["table"]="person"
tranformerParmeters["table"]="film"
tranformerParmeters["condition"]="select * from film where language_id=2"
println(templateFilePath)
// when
XPathTransformUseCase().transform(dbFilePath, trasformerName, trasformerDirection, trasformerVersion,tranformerParmeters,OutputStreamWriter(System.out))
val newDb = XPathTransformUseCase().transform(dbFilePath, templateFilePath, xrules, tranformerParmeters, StringWriter())
// then
// print to console output
*/
}
......
<changeSet id="234">
<createTable name="${table[0]}1" id="" view="${table[0]}" condition="${condition1}">
<columns>
<#list keys as key>
<columns name="${key}" id="id.${key}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list lhss as lhs>
<columns name="${lhs}" id="id.${lhs}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list rhss as rhs>
<columns name="${rhs}" id="id.${rhs}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list rests as rest>
<columns name="${rest}" id="id.${rest}" dbname="" nullable="true" dbtype=""/>
</#list>
</columns>
</createTable>
<createTable name="${table[0]}2" id="" view="${table[0]}" condition="${condition2}">
<columns>
<#list keys as key>
<columns name="${key}" id="id.${key}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list lhss as lhs>
<columns name="${lhs}" id="id.${lhs}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list rhss as rhs>
<columns name="${rhs}" id="id.${rhs}" dbname="" nullable="false" dbtype=""/>
</#list>
<#list rests as rest>
<columns name="${rest}" id="id.${rest}" dbname="" nullable="true" dbtype=""/>
</#list>
</columns>
</createTable>
<createConstraint name="${table[0]}.doubleInclusion" id="" type="DOUBLE_INCLUSION">
<source name="" id="" table="${table[0]}1">
<columns>
<#list lhss as lhs>
<columns name="${lhs}" id="id.${lhs}" dbname="" nullable="false" dbtype=""/>
</#list>
</columns>
</source>
<target name="" id="" table="${table[0]}2">
<columns>
<#list lhss as lhs>
<columns name="${lhs}" id="id.${lhs}" dbname="" nullable="false" dbtype=""/>
</#list>
</columns>
</target>
</createConstraint>
<createConstraint name="${table[0]}2.primaryKey" id="" type="PRIMARY_KEY">
<source name="" id="" table="${table[0]}2">
<columns>
<#list lhss as lhs>
<columns name="${lhs}" id="id.${lhs}" dbname="" nullable="false" dbtype=""/>
</#list>
</columns>
</source>
<target name="" id="" table="">
<columns>
<columns name="" id="" dbname="" nullable="false" dbtype=""/>
</columns>
</target>
</createConstraint>
<createConstraint name="${table[0]}1.primaryKey" id="" type="PRIMARY_KEY">
<source name="" id="" table="${table[0]}1">
<columns>
<#list keys as key>
<columns name="${key}" id="id.${key}" dbname="" nullable="false" dbtype=""/>
</#list>
</columns>
</source>
<target name="" id="" table="">
<columns>
<columns name="" id="" dbname="" nullable="false" dbtype=""/>
</columns>
</target>
</createConstraint>
<dropTable path="" schemaName="" tableName="${table[0]}"/>
<dropConstraint path="" schemaName="" constraintName="${table[0]}.primaryKey"/>
</changeSet>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment