All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.base4j.mybatis.sql.template.ftl.oracle.ftl Maven / Gradle / Ivy
<#if cache?? && cache == "MYBATIS">
#if>
<#list entityClassColumns as column>
<#if column.id>
jdbcType="${column.jdbcTypeName}"#if>
property="${column.property}"/>
#if>
#list>
<#list entityClassColumns as column>
<#if !column.id>
jdbcType="${column.jdbcTypeName}"#if>
property="${column.property}"/>
#if>
#list>
<#list mybatisAssociations as association>
<#list association.resultMap as result>
<#if result.id>
jdbcType="${result.jdbcTypeName}"#if>
property="${result.property}"/>
#if>
#list>
<#list association.resultMap as result>
<#if !result.id>
jdbcType="${result.jdbcTypeName}"#if>
property="${result.property}"/>
#if>
#list>
#list>
<#list mybatisConnections as connection>
<#list connection.resultMap as result>
<#if result.id>
jdbcType="${result.jdbcTypeName}"#if>
property="${result.property}"/>
#if>
#list>
<#list connection.resultMap as result>
<#if !result.id>
jdbcType="${result.jdbcTypeName}"#if>
property="${result.property}"/>
#if>
#list>
#list>
select SEQ_${name}_ID.NEXTVAL as ID from DUAL
<#list entityClassPKColumns as column>
select ${r'#{'}${column.property}<#if column.jdbcTypeName??>
,jdbcType=${column.jdbcTypeName}#if>${r'}'} as ID from DUAL
#list>
insert into ${name}
<#list entityClassColumns as column>
<#if column.id>
${column.column},
<#else>
${column.column},
#if>
#list>
<#list entityClassColumns as column>
<#if column.id>
${r'#{'}${column.property}<#if column.jdbcTypeName??>, jdbcType=${column.jdbcTypeName}#if>${r'}'},
<#else >
${r'#{'}${column.property}<#if column.jdbcTypeName??>, jdbcType=${column.jdbcTypeName}#if>${r'}'},
#if>
#list>
INSERT ALL
INTO ${name}
<#list entityClassColumns as column>
${column.column},
#list>
VALUES
<#list entityClassColumns as column>
${r'#{'}record.${column.property}<#if column.jdbcTypeName??>, jdbcType=${column.jdbcTypeName}#if>${r'}'},
#list>
SELECT 1 FROM DUAL
update ${name}
<#list entityClassColumns as column>
<#if !column.id>
${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'},
#if>
#list>
<#list entityClassPKColumns as column>
${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'} and
#list>
update ${name}
<#list entityClassColumns as column>
<#if !column.id>
${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'},
#if>
#list>
<#list entityClassPKColumns as column>
${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'} and
#list>
update ${name}
<#list entityClassColumns as column>
<#if !column.id>
${column.column} = ${r'#{record.'}${column.property}<#if column.jdbcTypeName??>
,jdbcType=${column.jdbcTypeName}#if>${r'}'},
#if>
#list>
and ${r'${criterion.condition}'}
and ${r'${criterion.condition} #{criterion.value}'}
and ${r'${criterion.condition} #{criterion.value} and #{criterion.secondValue}'}
and ${r'${criterion.condition}'}
${r'#{listItem}'}
1 = -1
1 = -1
update ${name}
<#list entityClassColumns as column>
${column.column} = ${r'#{record.'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'},
#list>
and ${r'${criterion.condition}'}
and ${r'${criterion.condition} #{criterion.value}'}
and ${r'${criterion.condition} #{criterion.value} and #{criterion.secondValue}'}
and ${r'${criterion.condition}'}
${r'#{listItem}'}
1 = -1
1 = -1
delete from ${name}
<#list entityClassPKColumns as column>
${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'} and
#list>
delete from ${name}
1 = -1
select
<#list entityClassColumns as column>
${name}.${column.column},
#list>
from ${name}
<#list entityClassPKColumns as column>
${name}.${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'} and
#list>
select
<#list entityClassColumns as column>
${name}.${column.column},
#list>
<#list mybatisAssociations as association>
<#list association.resultMap as result>
${association.property}.${result.column} as ${association.property}_${result.column},
#list>
#list>
<#list mybatisConnections as connection>
<#list connection.resultMap as result>
${connection.property}.${result.column} as ${connection.property}_${result.column},
#list>
#list>
from ${name}
<#list mybatisAssociations as association>
${association.joinCondition}
#list>
<#list mybatisConnections as connection>
${connection.joinCondition}
#list>
<#list entityClassPKColumns as column>
${name}.${column.column} = ${r'#{'}${column.property}<#if column.jdbcTypeName??>,
jdbcType=${column.jdbcTypeName}#if>${r'}'} and
#list>
select
${name}
.${r'${selectColumn}'}
<#list entityClassColumns as column>
${name}.${column.column},
#list>
from ${name}
ORDER BY ${r'${orderByClause}'}
select
${name}
.${r'${selectColumn}'}
<#list entityClassColumns as column>
${name}.${column.column},
#list>
<#list mybatisAssociations as association>
<#list association.resultMap as result>
${association.property}.${result.column} as ${association.property}_${result.column},
#list>
#list>
<#list mybatisConnections as connection>
<#list connection.resultMap as result>
${connection.property}.${result.column} as ${connection.property}_${result.column},
#list>
#list>
from ${name}
<#list mybatisAssociations as association>
${association.joinCondition}
#list>
<#list mybatisConnections as connection>
${connection.joinCondition}
#list>
ORDER BY ${r'${orderByClause}'}
select distinct
${name}
.${r'${selectColumn}'}
<#list entityClassColumns as column>
${name}.${column.column},
#list>
from ${name}
select distinct
${name}
.${r'${selectColumn}'}
<#list entityClassColumns as column>
${name}.${column.column},
#list>
<#list mybatisAssociations as association>
<#list association.resultMap as result>
${association.property}.${result.column} as ${association.property}_${result.column},
#list>
#list>
<#list mybatisConnections as connection>
<#list connection.resultMap as result>
${connection.property}.${result.column} as ${connection.property}_${result.column},
#list>
#list>
from ${name}
<#list mybatisAssociations as association>
${association.joinCondition}
#list>
<#list mybatisConnections as connection>
${connection.joinCondition}
#list>
select
count(*)
from ${name}
1 = -1
and ${r'${criterion.condition}'}
and ${name}.${r'${criterion.condition} #{criterion.value}'}
and ${name}.${r'${criterion.condition} #{criterion.value} and #{criterion.secondValue}'}
and ${name}.${r'${criterion.condition}'}
${r'#{listItem}'}