因为 实体类中的主键 是String类型 不能自动为其分配id  所以需要手动设置在service层   model.setId(UUID.randomUUID().toString());

报错:Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): cn.itcast.bos.domain.base.SubArea的更多相关文章

  1. Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.qingmu.seller.entity.OrderMaster

    org.springframework.orm.jpa.JpaSystemException: ids for this class must be manually assigned before ...

  2. org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

  3. 错误/异常:org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save() 的解决方法

    1.错误/异常视图 错误/异常描述:id的生成错误,在调用save()方法之前,必须先生成id. 2.解决方法     在对应的实体类的主键(id)的get方法上加上:@GeneratedValue( ...

  4. hibernate save数据的时候报错:ids for this class must be manually assigned before calling save()

    这个错误是因为eclipse  这种jpatools 自动生成的实体类内没把id 设置为自增,还有id的值在生成的时候默认为string 即使加上了也所以无法自增 ,所以还需要把string 换成In ...

  5. Hibernate: ids for this class must be manually assigned before calling save():

    原文: http://blog.csdn.net/softimes/article/details/7008875 引起问题的原因: 由Hibernate根据数据库表自动生成的"类名.hbm ...

  6. 报错Caused by: org.hibernate.AnnotationException: No identifier specified for entity:

    Caused by: org.hibernate.AnnotationException: No identifier specified for entity:. 原因: 1.没有给实体类ID 解决 ...

  7. org.hibernate.id.IdentifierGenerationException

    [问题]org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned bef ...

  8. 异常:org.hibernate.id.IdentifierGenerationException

    在有关联关系的数据表中保存数据时,先保存一端,再保存多端的抛出的异常(此时不管一端,还是多端的对象都没有设置id,属性,也就是要保存的两个对象的id 属性为空.) org.hibernate.id.I ...

  9. org.hibernate.id.IdentifierGenerationException错误解决方法

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

随机推荐

  1. iOS swift 语句只能写在函数体内

    1. 语句只能在函数体内: eg    因为我写在playground里面没报错  我直接放在这个位置就报错了 在这个.swift 文件里面 print 应该写在func 等方法(函数)里面 其他语句 ...

  2. c的详细学习(7)指针学习(一)

    指针是c语言的一个重要概念,指针类型是c语言最有特色的数据类型: *利用指针编写的程序可使调用函数共享变量或数据结构,实现双向数据通信: *可以实现内存空间的动态存储分配:可以提高程序的编译效率和执行 ...

  3. css3图片过滤效果

    在线演示 本地下载

  4. java项目常用架构

    三层架构 : 界面层/表现层 UI 业务逻辑层 BLL 针对具体的问题的操作,也可以理解成对数据层的操作,对数据业务逻辑处理. 数据访问层 DAL 访问数据库 mvc : 而 MVC 是在三层架构的基 ...

  5. php之定义大字符串数据时使用定界符来标识

    在定义大字符串数据时,通常使用定界符来标识,这种方式能保留文本中的格式,如文本中的换行.定界符使用格式如下. <<<identifier 格式化文本 identifier 其中,符号 ...

  6. Source not found The source attachment does not contain the source for the file MethodBeforeAdvice.class

  7. 在windows下进行linux开发:利用Vagrant+virtualbox

    1,介绍Vagrant 我们做web开发的时候经常要安装各种本地测试环境,比如apache,php,mysql,redis等等.出于个人使用习惯,可能我们还是比较习惯用windows.虽然说在wind ...

  8. [SQL类] SQL优化大全(推荐)

    概要 优化的理由 1. 大小写对SQL语句的影响(ORACLE) 2. 尽量使用(NOT) EXISTS 替代( NOT)IN这样的操作 3. 在海量查询时尽量少用格式转换 4. 查询海量数据是,可以 ...

  9. algorithm 简单用法

    algorithm 简单用法 #include <iostream> #include <vector> #include <algorithm> using na ...

  10. [转载]C++Assert()函数

    assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include <assert.h> void assert( i ...