Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Cannot get primary key value (mysql)

nicolas13

2010-08-11

Replies: Find Java Web Hosting

Author LoginPost Reply

Hello,

i've created a couple of entities with Eclipse's dali jpa tools, from my
Mysql (5.0.77) Database, with mysql 5.1.13 JDBC conenctor The issue is that
i can get the values of every column except the primary key (autoincremented
int 11). Can anyone please help me ? thanks

i'm using openjpa 2.0.0

Entity code:
@Entity
@Table(name="SOF_MIGRATION")
public class SofMigration implements Serializable {
 private static final long serialVersionUID = 1L;

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(unique=true, nullable=false)
 private int idMigration;

 private int consumedMigration;

 @Column(nullable=false, length=256)
 private String emailMigration;

 @Column(nullable=false, length=256)
 private String pwdMigration;

  public SofMigration() {
  }

 //snip getters and settings

}

Broker:
Query q = em.createQuery("SELECT mig FROM SofMigration mig");
--
Sent from the OpenJPA Users mailing list archive at Nabble.com.
©2008 gg3721.com - Jax Systems, LLC, U.S.A.