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

Supplying a CTE in fromValues() results in exception #302

Closed
Mobe91 opened this issue Nov 24, 2016 · 1 comment
Closed

Supplying a CTE in fromValues() results in exception #302

Mobe91 opened this issue Nov 24, 2016 · 1 comment
Assignees
Milestone

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Nov 24, 2016

This happens because the CTE subselect is used as table name in com.blazebit.persistence.impl.hibernate.HibernateJpaProvider#getColumnType:194.

@Mobe91
Copy link
Contributor Author

Mobe91 commented Nov 24, 2016

Easiest fix is to add

if (t.getSubselect() != null) {
    map.put("( " + t.getSubselect() + " )", t);
    Iterator<Column> columnIter = t.getColumnIterator();
    while (columnIter.hasNext()) {
           final Column column = columnIter.next();
           // populate column sql type
           column.getSqlType(dialect, mapping);
    }
}

to com.blazebit.persistence.impl.hibernate.SimpleDatabase.
We also need to supply org.hibernate.dialect.Dialect and org.hibernate.engine.spi.Mapping to com.blazebit.persistence.impl.hibernate.SimpleDatabase.

@beikov beikov added this to the 1.2.0 milestone Nov 28, 2016
@Mobe91 Mobe91 closed this as completed in 3c3e96a Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants