Hibernate is trying to create this database script to map my models, but the command create sequence is not supported by MySQL, launching a Syntax Error:
SQL Script:
Code:
# --- Rev:1,Ups - d4fd943
create table comment (
fromid varchar(255) not null,
text varchar(255),
time varchar(255),
constraint pk_comment primary key (fromid));
create table facebook_user (
uid varchar(255) not null,
first_name varchar(255),
last_name varchar(255),
constraint pk_facebook_user primary key (uid));
create table stream (
post_id varchar(255) not null,
created_time varchar(255),
message varchar(255),
permalink varchar(255),
constraint pk_stream primary key (post_id));
create sequence comment_seq;
create sequence facebook_user_seq;
create sequence stream_seq;
persistence.xml:
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>DefaultDS</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
</properties>
</persistence-unit>
</persistence>
Comment.java (one of the models - every model in the project follow this pattern -):
Code:
package models;
import javax.persistence.Entity;
import javax.persistence.Id;
import play.db.jpa.JPA;
import com.restfb.Facebook;
@Entity
public class Comment{
@Facebook
@Id
public String fromid;
@Facebook
public String text;
@Facebook
public String time;
@Override
public String toString() {
return String.format("%s, %s, %s", fromid, text, time);
}
public static Comment findById(String id) {
return JPA.em().find(Comment.class, id);
}
}
Anyone know whats is happened. Thanks in advance.