-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: create sequence being generated
PostPosted: Mon Jun 03, 2013 8:18 am 
Newbie

Joined: Mon Jun 03, 2013 8:07 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.