已经配置了jpa联合主键 注解注解怎么还报No identifier specified for entity: com.whucker.platform.domain.Student

他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)org.hibernate.AnnotationException: No identifier specified for entity Reported this anomaly because the entity bean's primary key is not mapping annotations @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name=&ID&, unique=true, nu
&Day one& of Hibernate's lazy loading - loading entity object delay Entity object is to delay load when the load entity object, such as session.load () when no data is loaded immediately, but when we call a property of the entity object methods,
Attribute identifier Hibernate's identifier property can also be known as the primary key Hibernate Identifier for each persistent object attribute gives a unique value, in order to differentiate persistent object Identifier attribute production stra
Last Turning back from the database using MyEclipse generate JPA entity classes of the way, this time we look closely associated with the use of hibernate framework using MyEclipse generate entity classes from database, the Hibernate reverse mode The
(2) - Hibernate Annotations without a primary key table, today wrote a jfreechar transmission of data from the background examples, compiled two tables casual lazy to write the primary key of the I use springmvc + hibernate the way, becaus
hibernate tutorial first part of the official entry - the first Hibernate program First we will create a simple console (console-based) Hibernate program. We use the built-in database (in-memory database) (HSQL DB), so we do not install any database
They come in here and are attributed to Sri Lanka. Hope to talk to some use. This is not trying to replace Hibernate Reference, relatively speaking, Hibernate Reference Purpose is the preparation easier for developers to provide the index entries, an
1. 为什么要有复合主键映射 在现实中我们可能会遇到许多表可能是没有主键的,那么我们对其做映射后使用会是什么样的结果?能正常得到我们想要的吗?结果应该是得不到想要的结果,而得到的可能会是如下的报错: Caused by:org.hibernate.AnnotationException: No identifier specified for entity: xxx.xxx.xxx 这个结果告诉我们:Hibernate映射表是需要主键的. 所以复合主键映射就应运而生了. 2. 注意点 复合主键使
Hibernate 代码调试记录 identifier of an instance of xxx was altered from {id} to {oid} 如下错误场景, /** * Created by liyanxin on . */ @Entity @Table(name = &tb_person&) public class Person implements Serializable { @Id @GeneratedValue(strategy = Ge
Lazy loading: Lazy loading mechanism is in order to avoid unnecessary performance overhead and put forward the so-called lazy loading is required when the real data at a time when the real implementation of the data load operation. At Hibernate provi
One-on-one associated mainly have three kinds of ways 1. The two primary key associated 2. Foreign key association 3. Associated table associated This hibernate annitation are three ways to provide support Here focus on the second configuration Confi
The realization of the framework 1.JPA MyEclipse7.1 can be added using the TopLink, Hibarnate, OpenJPA and EclipseLink. These types of frameworks, I have used a simple test. Basically no difference (of course, in terms of the JPA). The use of Hiberna
Lazy loading: Lazy loading mechanism is in order to avoid unnecessary performance overhead and put forward the so-called lazy loading is that when data in the real needs when we come to the real implementation of the data load operation. Provided in
In my article &using Xdoclet generated hbm file by POJOt not generate meta annotation problem& described xdoclet1 generate hibernate mapping file using some of the issues, this is no longer mentioned, and who are interested friends can see for y
Data, save, update and delete: 1, Session.save () method: Session.save () method is used to save the entity object persistence, that is when the implementation of the session.save () method will generate the corresponding insert SQL statement, the co
On the Hibernate's flush2008 on Saturday, January 26 11:39 [Change] http://bbs.tech.ccidnet.com/read.php?tid=570456&fpage=2 On the Hibernate's flush mechanism Hibernate in the Java development with wide application, we use Hibernate for object persis
A few days do not learn to forget these basic things, because in development, have become accustomed, when new people ask this, I really do not know how to answer them, and sort of a bit awkward, hibernate lazy. First: delay loading entity object &hi
1 Q: Hibernate always initialize error: java.lang.NoClassDefFoundError Hibernate error when initializing code: java.lang.NoClassDefFoundError: net / [size = medium] [/ size] sf / ehcache / CacheException A: This is new to frequently asked questions.
Background: 1. Services (Transaction) and the ACID properties Atomic (Atomicity): Service is an atomic operation unit, its data changes, or all of the implementation or not implementation of the whole. Consistency (Consistent): the beginning and comp
ORM mapping framework: Objects to relational database mapping O / R Mapping Hibernate second-level cache Only the entity object cache Level 2 cache, also known as process-level cache, also known as sessionFactory cache, secondary cache can be shared
Mashi Bing teacher recently read hibernate video watch the video to see the teacher get in a method of what looked Lao Bantian @ Id or confused, because they can not find the error when writing, then search the Internet some information, to find a so
hibernate.jdbc.fetch_size and hibernate.jdbc.batch_size hibernate.jdbc.fetch_size 50 hibernate.jdbc.batch_size 25 These two options are very, very important! ! ! Will seriously affect the performance of Hibernate's CRUD! C = create, R = read, U = upd
Java code org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize (AbstractLazyInitializer.java: 132) at org.hibernate.proxy.AbstractLazyInitializer.getImplementatio
1 Q: Hibernate always initialize error: java.lang.NoClassDefFoundErrorHibernate error when initializing code: java.lang.NoClassDefFoundError: net / sf / ehcache / CacheException A: This is new to frequently asked questions. Is because the default set
Hibernate in the Java development with wide application, we use Hibernate for object persistence operations have encountered a variety of issues. These problems are often caused by our lack of understanding of Hibernate, where I'll set my old problem
Hibernate defined in the resource file in the complex since the definition of sql, the flexibility to customize complex additions and deletions to change search Ci Fangfa not limited to the previous mode or hibernate xml Declaration annotating the en
1, Where is the use of cascade =&...&? cascade attribute does not have to use many relationships, and with it just let us, like when you insert or delete more convenient, as long as the source of the cascade to insert or delete, all the cascade
Reprinted: http://www.cnblogs.com/rongxh7/archive//1733088.html The four original capture strategy Hibernate recent performance optimization of the time Hibernate hit the &crawl strategy&, because not previously studied in detail, So t
Criteria query on object-oriented query conditions for the package, consistent with the programmer's way of thinking, but the HQL (Hibernate Query Language) queries to provide a more rich features and flexible query, so Hibernate HQL query methods wi
When the University of function that comes with Myeclipse automatically generated hibernate configuration file cfg.xml, entity class, hbm.xml and DAO, etc., after work, I have not used Myeclipse, but to use the eclipse, so to have hibernate eclipse p
Hibernate map association include: One to One (Persion - IDCard) One to many (Department - Employee) Many to one (Employee - Department) Many to many (Teacher - Student) Component mapping (User - Name) Collection of maps (Set, List, Map) inverse and
Hibernate map association include: One to One (Persion - IDCard) One to many (Department - Employee) Many to one (Employee - Department) Many to many (Teacher - Student) Component mapping (User - Name) Collection of maps (Set, List, Map) inverse and
Hibernate resource file defined in the complex custom sql, flexibility to customize complex CRUD This method is not limited to comments before the hibernate mode or xml declaration entity class. A definition of the resource that contains a custom sql
In hibernate, each table is an entity corresponding to the class, each class has a corresponding entity profile and you hbm.xml match, myeclipse in fact there is a MyEclipse Database Explorer view, it provides a direct database myeclipse Connect the
一.前言 1. 我为什么要做这个实验 到2011年寒假之末,我终于把当前java主流的三大开源框架--hibernate,struts,spring--初步学完.我看的是尚学堂马士兵老师的视频教程.学完后觉得必须找点东西练练手,于是自己意淫出一个小项目,计划用三大框架,结合软件工程的一些知识去把它做出来,以巩固刚学到一些用法. 但是,我在开始就遇到了难题--数据库如何设计.hibernate里的关联是啥回事.ER图如何设计?这时我才发现我其实根本就不懂数据库.记得我当时是如何开心而轻松的看完马士
jsp原理 一.JSP工作原理 JSP程序需要运行于特定的Web服务器中,例如Tomcat/WebLogic等.所有JSP文件,在执行的时候都会被服务器端的JSP引擎转换为Servlet程序(Java源文件),然后调用Java编译器将Servlet程序编译为class文件(字节码文件),并由Java虚拟机(JVM)解释执行.JSP的运行原理如图所示: 在一个JSP文件第一次被请求时,JSP引擎把该JSP文件转换成为一个servlet.而这个引擎本身也是一个servlet,在JSWDK或WEBLO
第一步:搭建一个springmvc工程,需要的jar有: 第二步:配置工程的web.xml文件. &?xml version=&1.0& encoding=&UTF-8&?& &web-app xmlns:xsi=&http://www.w3.org/2001/XMLSchema-instance& xmlns=&http://java.sun.com/xml/ns/javaee& xmlns:web=&qu
使用hibernate 注解配置实体类的关联关系,在many-to-one,one-to-one关联中,一边引用自另一边的属性,如果属性值为某某的数据在数据库不存在了,hibernate默认会抛出异常.解决此问题,加上如下注解就可以了: @NotFound(action=NotFoundAction.IGNORE),意思是找不到引用的外键数据时忽略,NotFound默认是exception 下面贴出hibernate 注解的实例代码 @Entity @Table(name = &ICT_COMP
@Where in hibernate can be applied at entity level. With the help of @Where , we can use where class to fetch the data. The entity will be populated only for those data for which @Where clause returns true. Find the example below. Find the example. S
配置文件hibernate.cfg.xml: &?xml version='1.0' encoding='UTF-8'?& &!DOCTYPE hibernate-configuration PUBLIC &-//Hibernate/Hibernate Configuration DTD 3.0//EN& &http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&& &
1. 环境配置 1.1 hiberante环境配置 hibernate可实现面向对象的数据存储.hibernate的官网:http://hibernate.org/ 官网上选择hibernate ORM,可以下载最新的hibernate,还有配套的document教程 http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html_single/ .下载到的hibernate文件夹中有document文档(hibernate\documenta
学过hibernate的人都可能都知道hibernate有三种状态,transient(瞬时状态),persistent(持久化状态)以及detached(离线状态),大家伙也许也知道这三者之间的区别,比如瞬时状态就是刚new出来一个对象,还没有被保存到数据库中,持久化状态就是已经被保存到数据库中,离线状态就是数据库中有,但是session中不存在该对象.但是大家又是否对hibernate的session的那几个特殊方法一清二楚呢?或者说大家是否能够一眼就快速看出一个测试用例在反复的调用sess
A . Use Hibernate to achieve the purpose of data storage 1. New Project Hibernate _0100_HelloWorld 1.1 New Student under the project .java, Package called com .bjsxt.hibernate.model, Source code is as follows : package com.bjsxt.hibernate. publ
Delete songs do today, when there org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn .. entity.Song # 1] problem, but view the table after, id value is there. After a search, found a table id field of type CHAR (22),
A simple example of Compass Compass is a package of the Lucene framework. Compass of the API can be used easily index, delete the index and achieve retrieval. Compass very much like Hibernate, Compass encapsulates encapsulates Lucene Hibernate JDBC o
Remove song doing today, when there org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn .. entity.Song # 1] problem, but after viewing the table, id value is there. After some search, found in the table id field of typ
ConcurrentHashMap and CopyOnWriteArrayList comparison. Blog categories: Java ConcurrentHashMap ConcurrentHashMap introduced Segment, each Segment is a hashtable, the equivalent of two Hash table, and then lock in the Segment level, and increased conc
Androidpn client的运行步骤 创建ServiceManger对象,设置提醒时候的图标 1) 读取raw下的andriodpn.properties信息,apikey.xmppHost.xmppPort 2) 创建client_preferences.xml 并存入信息apikey.xmppHost.xmppPort.version.CALLBACK_ACTIVITY_CLASS_NAME.CALLBACK_ACTIVITY_PACKAGE_NAME 信息 开启服务 1) 创建ser
(1) add struts2 supports 1. Import jar package freemarker.jar,ognl.jar,struts2-core.jar,xwork.jar, It is important to note that ,struts2-core.jar And struts2 -all.jar Cannot coexist. 2. Add struts .xml &?xml version=&1.0& encoding=&UTF-8
Several java object (PO, VO, DAO, BO, POJO) explained that one, PO: persistant object persistent objects, can be seen as the facade of the database mapping java objects. The simplest PO is a corresponding database table in a record, multiple records
Copyright (C) , All Rights Reserved.
版权所有 闽ICP备号
processed in 0.061 (s). 9 q(s)无法启动应用服务,异常日志如下所示:严重:&Exception&sending&context&initialized&event&to&listener&instance&of@b@@b@&class&org.springframework.web.context.ContextLoaderListener@b@org.springframework.beans.factory@b@.BeanCreationException:&Error&creating&bean&with&name&@b@sessionFactory&&defined&in&file&[... @b@argetclassesapplicationContext-conf.xml]:&Invocation&of&init&method&@b@&nested&exception&is&org.hibernate.@b@&AnnotationException:&No&identifier&specified&for&entity:&com.xx.po.TstPo@b@&&&&at&org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.@b@&&&&initializeBean(AbstractAutowireCapableBeanFactory.java:1482)@b@&&&&at&org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.@b@&&&&doCreateBean(AbstractAutowireCapableBeanFactory.java:521)@b@&&&&at&org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.@b@&&&&createBean(AbstractAutowireCapableBeanFactory.java:458)@b@&&&&at&org.springframework.beans.factory.support.@b@&&&&AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)@b@&&&&at&org.springframework.beans.factory.support.@b@&&&&DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)@b@&&&&at&org.springframework.beans.factory.support.@b@&&&&AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)@b@&&&&at&org.springframework.beans.factory.support.@b@&&&&AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)@b@&&&&at&org.springframework.beans.factory.support.@b@&&&&DefaultListableBeanFactory@b@&&&&.preInstantiateSingletons(DefaultListableBeanFactory.java:610)@b@&&&&at&org.springframework.context.support.@b@&&&&AbstractApplicationContext@b@&&&&.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)@b@&&&&at&org.springframework.context.support@b@&&&&.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)@b@&&&&at&org.springframework.web.context.ContextLoader@b@&&&&.configureAndRefreshWebApplicationContext(ContextLoader.java:389)@b@&&&&at&org.springframework.web.context.ContextLoader@b@&&&&.initWebApplicationContext(ContextLoader.java:294)@b@&&&&at&org.springframework.web.context@b@&&&&.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)@b@&&&&at&org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)@b@&&&&at&org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)@b@&&&&at&org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)@b@&&&&at&org.apache.catalina.core.StandardHost.start(StandardHost.java:785)@b@&&&&at&org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)@b@&&&&at&org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)@b@&&&&at&org.apache.catalina.startup.Embedded.start(Embedded.java:825)@b@&&&&at&org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)@b@&&&&at&org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)@b@&&&&at&org.apache.maven.plugin.DefaultBuildPluginManager@b@&&&&.executeMojo(DefaultBuildPluginManager.java:105)@b@&&&&at&org.apache.maven.lifecycle.DefaultLifecycleExecutor@b@&&&&.execute(DefaultLifecycleExecutor.java:577)@b@&&&&at&org.apache.maven.lifecycle.DefaultLifecycleExecutor@b@&&&&.execute(DefaultLifecycleExecutor.java:324)@b@&&&&at&org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)@b@&&&&at&org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)@b@&&&&at&org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)@b@&&&&at&org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)@b@&&&&at&org.apache.maven.cli.MavenCli.main(MavenCli.java:121)@b@&&&&at&sun.reflect.NativeMethodAccessorImpl.invoke0(Native&Method)@b@&&&&at&sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)@b@&&&&at&sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)@b@&&&&at&java.lang.reflect.Method.invoke(Method.java:597)@b@&&&&at&org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)@b@&&&&at&org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)@b@&&&&at&org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)@b@&&&&at&org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)@b@Caused&by:&org.hibernate.AnnotationException:&No&identifier&specified&for&entity:&com.xx.po.TstPo@b@&&&&at&org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:277)@b@&&&&at&org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:224)@b@&&&&at&org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:665)@b@&&&&at&org.hibernate.cfg.Configuration$MetadataSourceQueue@b@&&&&.processAnnotatedClassesQueue(Configuration.java:3533)@b@&&&&at&org.hibernate.cfg.Configuration$MetadataSourceQueue@b@&&&&.processMetadata(Configuration.java:3487)@b@&&&&at&org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1376)@b@&&&&at&org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1777)@b@&&&&at&org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1861)@b@&&&&at&org.springframework.orm.hibernate4.LocalSessionFactoryBuilder@b@&&&&.buildSessionFactory(LocalSessionFactoryBuilder.java:247)@b@&&&&at&org.springframework.orm.hibernate4.LocalSessionFactoryBean@b@&&&&.buildSessionFactory(LocalSessionFactoryBean.java:373)@b@&&&&at&org.springframework.orm.hibernate4.LocalSessionFactoryBean@b@&&&&.afterPropertiesSet(LocalSessionFactoryBean.java:358)@b@&&&&at&org.springframework.beans.factory.support@b@&&&&.AbstractAutowireCapableBeanFactory@b@&&&&.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)@b@&&&&at&org.springframework.beans.factory.support@b@&&&&.AbstractAutowireCapableBeanFactory@b@&&&&.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)@b@&&&&...&37&more原有持久化实体类代码如下:@Entity@b@@Table(name&=&"TAB_TSTPO")@b@public&class&TstPo{@b@&&&&@b@&&&&private&static&final&long&serialVersionUID&=&-1L;@b@&&&&@b@&&&&private&@b@&&&&private&String&reM@b@&&&@b@&&&@b@&&&&@b@&&&&@Column(name="name")@b@&&&&public&String&getName()&{@b@&&&&&&&&return&@b@&&&&}@b@&&&&&@b@&&&&public&void&setReMark(String&name)&{@b@&&&&&&&&this.name&=&@b@&&&&}@b@&&&&&@b@&&&&@Column(name="REMARK")@b@&&&&public&String&getReMark()&{@b@&&&&&&&&return&reM@b@&&&&}@b@&&&&&@b@&&&&public&void&setReMark(String&reMark)&{@b@&&&&&&&&this.reMark&=&reM@b@&&&&}@b@&&&&@b@}解决方法,修改TstPo实体类,配置其主键生成生成方式,具体如下所示:@Entity@b@@Table(name&=&"TAB_TSTPO")@b@public&class&TstPo{@b@&&&&@b@&&&&private&static&final&long&serialVersionUID&=&-1L;@b@&&&&private&String&@b@&&&&private&@b@&&&&private&String&reM@b@&&&&@b@&&&&@Id@b@&&&&@Indexable(name="id",&id=true)@b@&&&&@GeneratedValue(generator&=&"TstPoGenerator")@b@&&&&@GenericGenerator(name&=&"TstPoGenerator",&strategy&=&"org.hibernate.id.SequenceGenerator")@b@&&&&public&String&getId()&{@b@&&&&&&&&return&@b@&&&&}@b@@b@&&&&public&void&setId(String&id)&{@b@&&&&&&&&this.id&=&@b@&&&&}&@b@&&&&@b@&&&&@Column(name="name")@b@&&&&public&String&getName()&{@b@&&&&&&&&return&@b@&&&&}@b@&&&&&@b@&&&&public&void&setReMark(String&name)&{@b@&&&&&&&&this.name&=&@b@&&&&}@b@&&&&&@b@&&&&@Column(name="REMARK")@b@&&&&public&String&getReMark()&{@b@&&&&&&&&return&reM@b@&&&&}@b@&&&&&@b@&&&&public&void&setReMark(String&reMark)&{@b@&&&&&&&&this.reMark&=&reM@b@&&&&}@b@&&&&@b@}
◆&相关内容

我要回帖

更多关于 主键注解 的文章

 

随机推荐