spring+hibernate 框架下使用uuid.hex的疑惑

hasan198703 2008-10-14 09:47:16
不知道为什么,我把主键设置为uuid.hex 就没反应,不报错 就是插入不了数值, 但是换成native马上就可以
请问各位,这究竟是为什么??
drop table person;
create table person(

id varchar(32) not null primary key,

name varchar(20) not null,

password varchar(20) not null

);

commit;


调用代码:
public static void main(String[] args) {

ApplicationContext ctx=null;

ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
PersonDAOImpel pdl=(PersonDAOImpel)ctx.getBean("persondao");

Person per=new Person();

per.setName("张三");
per.setPassword("454654");
pdl.insert(per);

}



实现代码:
package com.guoc.ssh.impel;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.guoc.ssh.vo.Person;

public class PersonDAOImpel extends HibernateDaoSupport {

public void insert(Person per){
this.getSession().save(per);

}


}

...全文
251 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Landor2004 2008-10-14
  • 打赏
  • 举报
回复
this.getSession().save(per);
this.getSession().flush();
freefree 2008-10-14
  • 打赏
  • 举报
回复
你的配置文件怎么设置的?
bufeng711 2008-10-14
  • 打赏
  • 举报
回复
你的控制台 有语句打印吗?

67,537

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧