Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing CDATA block contents in Query Tags out of orm.xml #200

Open
Marloto opened this issue Jul 10, 2013 · 0 comments
Open

Missing CDATA block contents in Query Tags out of orm.xml #200

Marloto opened this issue Jul 10, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@Marloto
Copy link

Marloto commented Jul 10, 2013

In case of long orm.xml files, some queries will not read completly. In log file you will see something like:

Start of element url: http://java.sun.com/xml/ns/persistence/orm, localName: query, qName: query, attributes: {}
Element body SE
Element body LECT o FROM SomeDatabaseEntrie o WHERE o.someAttribute=:abc
End of element url: http://java.sun.com/xml/ns/persistence/orm, localName: query, qName: query

If this happens, the named query parsing will fail with last "element body" block, in this example something like this: "LECT o FROM SomeDatabaseEntrie o WHERE o.someAttribute=:abc" can't parsed as named query.

I think this could be solved by concat CDATA blocks in QueryElement implementation:

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    public void cdata(String cdata) {
        if(this.query == null)
            this.query = "";
        this.query += cdata;
    }

    /**
     * Returns the query.
     * 
     * @return the query
     * 
     * @since 2.0.0
     */
    public String getQuery() {
        return this.query.trim();
    }
@asimarslan asimarslan added the bug label Oct 26, 2014
@asimarslan asimarslan added this to the 2.0.1.3 milestone Oct 26, 2014
@asimarslan asimarslan self-assigned this Oct 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants