小编Dea*_*edy的帖子

插入触发器后更新另一个表的列的mysql

我正在尝试编写一个触发器,我有以下表格:BookingRequest:

  +-----------+---------+------+-----+---------+----------------+
    | Field     | Type    | Null | Key | Default | Extra          |
    +-----------+---------+------+-----+---------+----------------+
    | idRequest | int(11) | NO   | PRI | NULL    | auto_increment |
    | roomClass | int(11) | NO   |     | NULL    |                |
    | inDate    | date    | NO   |     | NULL    |                |
    | outDate   | date    | NO   |     | NULL    |                |
    | numOfBeds | int(11) | NO   |     | NULL    |                |
    | status    | int(11) | NO   | …
Run Code Online (Sandbox Code Playgroud)

mysql triggers sql-update

27
推荐指数
2
解决办法
10万
查看次数

JPQL:无法将状态字段路径解析为有效类型

我不能使这个查询工作:

Query query = eManager.createQuery("select c FROM News c WHERE c.NEWSID = :id",News.class);
        return (News)query.setParameter("id", newsId).getSingleResult();
Run Code Online (Sandbox Code Playgroud)

我得到了这个例外:

Exception Description: Problem compiling [select c FROM News c WHERE c.NEWSID = :id]. 
[27, 35] The state field path 'c.NEWSID' cannot be resolved to a valid type.] with root cause
Local Exception Stack: 
Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [select c FROM News c WHERE c.NEWSID = :id]. 
Run Code Online (Sandbox Code Playgroud)

为什么会这样?:id和命名参数是相同的

编辑: 我的实体类

@Entity
@Table(name="NEWS")
public class News implements …
Run Code Online (Sandbox Code Playgroud)

jpql

7
推荐指数
1
解决办法
3万
查看次数

XSLT:添加新元素时排除名称空间

我需要使用xalan重定向扩展名将新元素添加到现有xml文件中,但是命名空间存在问题。

my xslt : 
<xsl:stylesheet version="1.0"
    xmlns:redirect="http://xml.apache.org/xalan/redirect"
    extension-element-prefixes="redirect" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:validator="xalan://com.epam.app.transformation.Validator"
    xmlns:t="http://www.products.com" exclude-result-prefixes="#default t">
    <xsl:import href="addProductPage.xsl" />
    <xsl:param name="name"></xsl:param>
    <xsl:param name="provider"></xsl:param>
    <xsl:param name="model"></xsl:param>
    <xsl:param name="color"></xsl:param>
    <xsl:param name="dateOfIssue"></xsl:param>
    <xsl:param name="notInStock"></xsl:param>
    <xsl:param name="price"></xsl:param>
    <xsl:param name="filename"></xsl:param>
    <xsl:param name="isValid"
        select="validator:validateFields($name, $provider, $model, $dateOfIssue, $color,$price,$notInStock)" />
    <xsl:param name="categoryName"></xsl:param>
    <xsl:param name="subcategoryName"></xsl:param>

    <xsl:output omit-xml-declaration="yes" indent="no" />
    <xsl:template match="/" priority="2">
        <html>
            <head>
                <title>Products Home Page</title>
            </head>
            <body>
                <xsl:choose>
                    <xsl:when test="$isValid">
                        <redirect:write select="$filename" append="false">

                            <xsl:call-template name="saveProduct" />
                        </redirect:write>
                        <xsl:call-template name="returnToProducts" />
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:call-template name="addProduct" />
                                            <!-- i show errors …
Run Code Online (Sandbox Code Playgroud)

xml xslt xalan

0
推荐指数
1
解决办法
2261
查看次数

标签 统计

jpql ×1

mysql ×1

sql-update ×1

triggers ×1

xalan ×1

xml ×1

xslt ×1