Hibernate version: 3.1.1
Exception:
- Unknown table 'SEQ_..._PK' in field list
- Every derived table must have its own alias
Database: MysqL
Hello, I'm working on a webapplication and until now it has always worked with Oracle.
But I'm currently busy to make the webapp also use MySQL.
The first problem I have is that we've declared this in the xdoclet;
Code:
* @bo.id
* column="xxx_id"
* type="INTEGER"
* length="32"
* required="true"
* generator-class="native"
* generator-sequence="SEQ_xxx_PK"
MySQL doesn't support sequences, so is there a way to solve this, that it'll work for MySQL and for Oracle?
The second problem I'm having is that I get the error "Every derived table must have its own alias".
And I'm just using Criteria to get the data, so Hibernate generates the query for me... how can I solve this?
For example;
Code:
Criteria criteria = session.createCriteria(TimeRecord.class);
criteria.add(Expression.eq("flowState", FlowState.CLOSED));
criteria = criteria.createCriteria("assignment");
Criterion closed = Expression.eq("flowState", FlowState.CLOSED);
Criterion exported = Expression.eq("flowState", FlowState.EXPORTED);
criteria.add(Expression.or(closed, exported));
Collection records = criteria.list();