Primary Key « POJO « JPA Q&A





1. Create POJO class for the table without primary key    forum.hibernate.org

I have been using NetBeans 6.9.1 to create the POJO class and mapping files for the tables in the DB. There I can create both for tables with primary name but can't create for one without primary key. Is there any reason we should not or can't create POJO for table without primary key? There must be workaround for it am ...

2. primary key in my Pojo with a different value    forum.hibernate.org

version: Hibernate 3 db: MySql dialect: org.hibernate.dialect.MySQLDialect table creation: create table if not exists myTable ( pk integer(10) unsigned not null auto_increment primary key, name char(35), ) TYPE=INNODB; mapping: In my Pojo class, my primary key is using a java.lang.Long. When I run a simple select with hibernate, the field ...

3. get pojo primary key    forum.hibernate.org

I surgest you make a Domain object that extends all of your data objects (pojos) and make a getPK() method in each of the Domain objects that calls the correct method in your pojo for the PK. you will obviously have to identiy this method by hand for each obecjt. the advantage of doing it this way is all the effort ...