[SEAM] 又是麻烦问题,mysql的,想在转投derby之前发帖问问

pf_miles 2008-03-07
我的数据库服务器版本是:MySQL 5.0.45-Debian_1ubuntu3.1
客户端版本是:MySQL Client Version 5.0.45
JDBC驱动是官网上最新的conector/j 5.1.5

我的persistence.xml文件:
<persistence-unit name="Messages2">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:/Messages2Datasource</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="create"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/Messages2EntityManagerFactory"/>
      </properties>
   </persistence-unit>


也就是说我想让seam中的hibernate工具为我生成数据库表。这些配置应该都没问题了。但框架生成的sql语句却报错了:
create table message (id bigint not null auto_increment, title varchar(100) not null, text text not null, read bit not null, dateTime datetime not null, primary key (id))
上面是框架生成的sql语句,但却报下面的错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read bit not null, dateTime datetime not null, primary key (id))' at line 1
上网搜了好久,不知道是不是mysql的bug,我换了各种mysql的dialect配置,还是没有一个能行的。也就是说框架生成的语句不符合mysql的要求...那么,要怎么才能生成正确的sql语句?清指教!
pf_miles 2008-03-08
问题解决了,“read”是mysql的关键字,不能用作字段名...居然是这种原因,我真的要吐血了...
这里好像不太活跃啊,喜欢seam的人都站起来吧,虽然国内seam没什么群众基础,但我看好这个思想想当超前的全栈式框架,我觉得它就是下一代Java EE标准的影子。
isky 2008-05-30
jboss.entity.manager.jndi.name
decription :  JBoss does not publish container managed EntityManagers in JNDI by default. Use this to bind it. 

jboss.entity.manager.factory.jndi.name
decription : JBoss does not publish container managed EntityManagerFactorys in JNDI by default. Use this to bind it. 

jboss.no.implicit.datasource.dependency
decription : JBoss tries to register deployment dependencies for datasource by guessing the dependency name based on the jndi name of the datasource. Use this switch if the guess is wrong. 

那位深刻滴介绍一下??
Global site tag (gtag.js) - Google Analytics