AD

2010.03.09 (2) - Hibernate Annotations without a primary key table

2010.03.09 (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, because there is no primary key My comments are as follows:
@Entity
@Table(name="JIANZHU")
public class JianZhu {
        private String name;
        private Integer value;
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public Integer getValue() {
                return value;
        }
        public void setValue(Integer value) {
                this.value = value;
        }
        
}

Then it will start the tomcat has been reported that an exception:
org.hibernate.AnnotationException: No identifier specified for entity: pojo.JianZhu

Later, I will seek to raise the anger of a id, all was well

@Entity
@Table(name="JIANZHU")
public class JianZhu {
        private String name;
        private Integer value;
        @Id
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public Integer getValue() {
                return value;
        }
        public void setValue(Integer value) {
                this.value = value;
        }
        
}
标签: string name, public string, entity table, public void, tomcat, pojo, two tables, integer value, anger, background examples
分类: Java
时间: 2010-04-04

相关文章

  1. 2010.03.09 (3) - JfreeChart interact with the background of the histogram

    2010.03.09 (3) - JfreeChart interact with the background of the histogram Can achieve the purpose of this exam ...
  2. 2010.03.09 - JfreeChart of the histogram

    2010.03.09 - JfreeChart of the histogram package pojo; import java.awt.Color; import java.awt.Font; import jav ...
  3. Problem: hibernate annotations, Criteria query, update the table field

    Objective: To query the data in a table Problem: hibernate annotations, Criteria query table data, update the ...
  4. Introduction to Hibernate Notes (7) the primary key

    Introduction to Hibernate Notes Joint primary key package eg; public class DomainPK implements java.io.Seriali ...
  5. Hibernate type of the primary key

    1) assigned Responsible for the primary key generated by an external program without Hibernate participation. ...
  6. Development of the Hibernate persistence layer database primary key

    1, Assigned, generate primary key values ​​determined entirely by the user, has nothing to do with the underly ...
  7. Hibernate Configuration Guide - the primary key generation strategy

    Life and death process error, I After half a day , tracking in the end, until suddenly, hibernate analytic sql ...
  8. hibernate3 annotations to generate an embedded composite primary key or primary key of the method and examples of

    The continuous development of Hibernate, Java database persistence almost become a de facto standard, because ...
  9. Hibernate annotation-one relations share the primary key configuration

    Hibernate annotation-one relations share the primary key configuration Zhou Jianhua, Wuhan University of Scien ...
  10. HIbernate primary key generation

    HIbernate primary key Xiangjie ------ Assigned Assigned way primary key value is generated by the program, and ...
  11. Hibernate primary key generation mechanism

    Let's look at the label the primary key mapping: <id (1)name="propertyName" (2)column="colum ...
  12. Hibernate composite primary key

    When a table has multiple fields in a composite primary key, hibernate how to handle it? A composite primary k ...
  13. July 26, 2010 - Oracle database table of the primary key of the table to delete the primary key

    June 26, 2010 --- Oracle to delete the primary key table. Modify the primary key constraint: alter table ticke ...
  14. hibernate primary key generation strategy (generator) Detailed

    identity: the identifier generated by the underlying database. identity is generated by the database itself, b ...
  15. 2010.03.02 (2) - google map api with a page annotation

    2010.03.02 (2) - google map api with a page annotation <%@ page language="java" import="java ...
  16. 2010.03.10 - JfreeChart interact with the background of the pie

    2010.03.10 - JfreeChart interact with the background of the pie Can achieve the purpose of this example: From ...
  17. 2010.03.10 (4) - FusionCharts of the XML tag attributes

    2010.03.10 (4) - FusionCharts of the XML tag attributes Reference: http://blog.csdn.net/gchg1030/archive/2009/ ...
  18. 2010.03.11 (3) - FusionChartsFree get it from the background data and dynamic data source

    2010.03.11 (3) - FusionChartsFree get it from the background data and dynamic data source To do this today fro ...
  19. Hibernate Annotations Error Summary

    org.hibernate.AnnotationException: Use of @ OneToMany or @ ManyToMany targeting an unmapped class A look into ...