meta xsl поправил авто-генерацию extends
This commit is contained in:
parent
a4f2da37d4
commit
c4c12ccad7
2 changed files with 23 additions and 26 deletions
|
|
@ -73,12 +73,12 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.EVENT_TYPE IS '
|
|||
<xsl:variable name="tp" select="@type"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:when test="@linkKeyCode"></xsl:when>
|
||||
<!--<xsl:when test="@linkKeyCode"></xsl:when>-->
|
||||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise><xsl:if test="position() != '1'">, </xsl:if><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@linkKeyCode"></xsl:when>
|
||||
<!--<xsl:when test="@linkKeyCode"></xsl:when>-->
|
||||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text> </xsl:text><xsl:value-of select="/meta/types/*[@id=$tp]/@type"/>
|
||||
|
|
@ -96,7 +96,7 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name=
|
|||
|
||||
<xsl:template match="*" mode="comment-objects">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@linkKeyCode"></xsl:when>
|
||||
<!--<xsl:when test="@linkKeyCode"></xsl:when>-->
|
||||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name(parent::*)'/></xsl:call-template></xsl:variable>
|
||||
|
|
@ -106,7 +106,7 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name=
|
|||
|
||||
<xsl:template match="*" mode="comment-history-objects"><!-- todo похож на comment-objects только именем таблицы различается попробовать объединить -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="@linkKeyCode"></xsl:when>
|
||||
<!--<xsl:when test="@ "></xsl:when>-->
|
||||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name(parent::*)'/></xsl:call-template></xsl:variable>
|
||||
|
|
|
|||
|
|
@ -255,48 +255,44 @@ public class <xsl:value-of select="$nameObjFmt"/>HistoryMapStore extends Templat
|
|||
}
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="mapstore-field-getFields" ><xsl:if test="position() != '1'">, </xsl:if> "<xsl:choose>
|
||||
<xsl:template match="*" mode="mapstore-field-getFields" ><xsl:choose><xsl:when test="@extends"></xsl:when><xsl:otherwise><xsl:if test="position() != '1'">, </xsl:if> "<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>"</xsl:template>
|
||||
</xsl:choose>"</xsl:otherwise></xsl:choose></xsl:template>
|
||||
<xsl:template match="*" mode="mapstore-field-setters" >
|
||||
<xsl:variable name="tp" select="@type"/>
|
||||
<xsl:variable name="javatp" select="/meta/types/*[@id=$tp]/@javatype"/> <xsl:choose>
|
||||
<xsl:when test="$javatp='Instant'">
|
||||
object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getInstantFromTimestamp(resultSet, "<xsl:choose>
|
||||
<xsl:text> <!-- space   4 new line -->
|
||||
</xsl:text><xsl:if test="@extends">//ext: </xsl:if>
|
||||
<xsl:variable name="javatp" select="/meta/types/*[@id=$tp]/@javatype"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$javatp='Instant'">object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getInstantFromTimestamp(resultSet, "<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>"))</xsl:when>
|
||||
<xsl:when test="$javatp='LocalDate'">
|
||||
object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getLocalDateFromSqlDate(resultSet, "<xsl:choose>
|
||||
<xsl:when test="$javatp='LocalDate'">object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getLocalDateFromSqlDate(resultSet, "<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>"))</xsl:when>
|
||||
<xsl:when test="$javatp='LocalTime'">
|
||||
object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getLocalTimeFromSqlTime(resultSet, "<xsl:choose>
|
||||
<xsl:when test="$javatp='LocalTime'">object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(getLocalTimeFromSqlTime(resultSet, "<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>"))</xsl:when>
|
||||
<xsl:otherwise>
|
||||
object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(resultSet.getObject("<xsl:choose>
|
||||
<xsl:otherwise>object.set<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>(resultSet.getObject("<xsl:choose>
|
||||
<xsl:when test="@dbfield"><xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>", <xsl:value-of select="$javatp"/>.class))</xsl:otherwise>
|
||||
</xsl:choose>;</xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="mapstore-field-getters" ><xsl:if test="position() != '1'">, </xsl:if><!-- todo запятую в конце а не в начале, см. last()-->
|
||||
<xsl:template match="*" mode="mapstore-field-getters" ><xsl:if test="position() != '1' and not(@extends)">, </xsl:if><!-- todo запятую в конце а не в начале, см. last()-->
|
||||
<xsl:variable name="tp" select="@type"/>
|
||||
<xsl:variable name="javatp" select="/meta/types/*[@id=$tp]/@javatype"/>
|
||||
<xsl:text> <!-- space   4 new line -->
|
||||
</xsl:text><xsl:if test="@extends">//ext: </xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$javatp='Instant'">
|
||||
TimeUtil.toDateFromInstant(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:when test="$javatp='LocalDate'">
|
||||
TimeUtil.toDateFromLocalDate(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:when test="$javatp='LocalTime'">
|
||||
TimeUtil.toDateFromLocalTime(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:otherwise>
|
||||
object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>()</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:when test="$javatp='Instant'">TimeUtil.toDateFromInstant(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:when test="$javatp='LocalDate'">TimeUtil.toDateFromLocalDate(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:when test="$javatp='LocalTime'">TimeUtil.toDateFromLocalTime(object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>())</xsl:when>
|
||||
<xsl:otherwise>object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template>()</xsl:otherwise></xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
|
@ -305,7 +301,7 @@ object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconv
|
|||
|
||||
<xsl:variable name="tp" select="@type"/>
|
||||
|
||||
<xsl:if test="name()='id'"> // (in parent) </xsl:if> private <xsl:value-of select="/meta/types/*[@id=$tp]/@javatype"/> <xsl:text> <!-- space   --></xsl:text><xsl:value-of select="name()"/>;
|
||||
<xsl:if test="@extends"> // extend: </xsl:if><xsl:if test="name()='id'"> // (in parent) </xsl:if> private <xsl:value-of select="/meta/types/*[@id=$tp]/@javatype"/> <xsl:text> <!-- space   --></xsl:text><xsl:value-of select="name()"/>;
|
||||
<xsl:choose>
|
||||
<xsl:when test="@dbfield"> // DB field: <xsl:value-of select="@dbfield"/></xsl:when>
|
||||
<!-- new line -->
|
||||
|
|
@ -360,6 +356,7 @@ object.get<xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconv
|
|||
<xsl:variable name="tp" select="@type"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="name()='id'"></xsl:when>
|
||||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="NameFmt"><xsl:call-template name='convertFirstUC_'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:variable>
|
||||
public <xsl:value-of select="/meta/types/*[@id=$tp]/@javatype"/> get<xsl:value-of select="$NameFmt"/>() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue