Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HSQL dialect does not work on SQL Server 2008 express

843830Jul 22 2010 — edited Jul 22 2010
Hello,

I am developing simple ejb3 example and in persistence.xml i use HSQLDialect instead of SQLServerDialect, i use jboss-4.2.3.GA AS, and when i deploy my application the error occurs during deployment,here is error
DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] create table STUDENT (STUD_ID integer generated by default as identity (start with 1), STUD_NAME varchar(255), primary key (STUD_ID))
ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: create table STUDENT (STUD_ID integer generated by default as identity (start with 1), STUD_NAME varchar(255), primary key (STUD_ID))
ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Incorrect syntax near 'generated'.
here is persistence.xml
<persistence >
	<persistence-unit name="test">
		<jta-data-source>java:/EjbExampleDS</jta-data-source>
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<properties>
			<property name="hibernate.hbm2ddl.auto" value="create-drop" />
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
		</properties>
	</persistence-unit>
</persistence>
and here is my entity:
import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@SuppressWarnings("serial")
@Table(name = "STUDENT")
public class Student implements Serializable {
	private int id;
	private String name;

	public Student() {

	}

	public Student(String name) {
		this.name = name;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "STUD_ID", nullable = false)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "STUD_NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
but this dialect works fine on mysql,

so my problem is that i want to use one dialect within many databases,is there any suggestion/solution?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2010
Added on Jul 22 2010
3 comments
499 views