primary key « Data Type « JPA Q&A





1. Configure Hibernate to use Oracle's SYS_GUID() for Primary Key    stackoverflow.com

I am looking for a way to get hibernate to use oracle's SYS_GUID() function when inserting new rows. Currently my DB tables have SYS_GUID() as the default so if hibernate simply ...

2. Hibernate and padding on CHAR primary key column in Oracle    stackoverflow.com

I'm having a little trouble using Hibernate with a char(6) column in Oracle. Here's the structure of the table:

CREATE TABLE ACCEPTANCE
(
   USER_ID char(6) PRIMARY KEY NOT NULL,
   ...

3. How to use UUID as primary key for Hibernate Entity?    stackoverflow.com

I am trying to use UUID in Hibernate. Have the following @Entity base-class description (with @MappedSuperclass annotation):

 @Id
 @Column(name="id")
 private UUID id;

 public UUID getId()
 {
  return id;
 }
For test, I ...

4. Problem obtaining entities with uniqueidentifier primary key    stackoverflow.com

In order to investigate whether Hibernate's behavior is different than NHibernate's for a particular usage scenario, I began writing a Java SE & Hibernate port of the relevant parts of ...

5. Database PK-FK design for future-effective-date entries?    stackoverflow.com

Ultimately I'm going to convert this into a Hibernate/JPA design. But I wanted to start out from purely a database perspective. We have various tables containing data that is future-effective-dated. Take ...

6. String as primary key in Hibernate    coderanch.com

Hi All I have table in the database (sqlserver) with varchar data type as primary key. I want to know what to use as primary key generatec class in the tablename.hbm.xml file. Like in case of numeric columns we use identity or hilo what will be an equivalent for String (varchar). I tried using uuid.hex but that generates a huge id ...

7. primary key is another datatype than the foreign key    forum.hibernate.org

Hi all, I am new to hibernate and just in the beginning I got a little problem. We have an old database and in one table the pk is an integer and in the other table the fk is a bigint. As soon as I am using a OneToMany and ManyToOne relation I got the following exception: [code] Caused by: org.hibernate.HibernateException: ...

8. entity class has changed but kept is name =>null primary key    forum.hibernate.org

org.hibernate.exception.ConstraintViolationException: could not insert: [de.bhc.pepa.Report] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) [...] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: Attempt to insert null into a non-nullable column: column: ID table: REPORTS in statement [insert into reports (id, dirname, project_id, zaehler) values (null, ?, ?, ?)] at ...

9. Why my program always insert NULL value to primary key?    forum.hibernate.org

Hi, All I am working on a ETL program, but my program always inset NULL value to primary key for one table, other tables work fine. In the table "cache_usage", the primary key is "test_id", and there is a foreign key "cache_config_pk1". In cacheUsage.hbm.xml Code: ...





10. Primary keys with char    forum.hibernate.org

I have some tables when the primary key are char(10) in like I have id's with property assigned (by requeriments of the system) sometimes I put keys with 7 characters or 8. But the problem is when I have to do a finder, because the querys dont return nothing. I have to put the data with blank characters to find something. ...

11. have same number of columns as the referenced primary key    forum.hibernate.org

Hello all Already I searched in several forums, Li the chapter .74 of the manual, but I did not manage to solve this situation, my level still belongs to beginner, because of this I ask for help from gentlemen. Situation: They are two tables, tbl_titulos and tbl_itulos_parcela. tbl_titulos (PK) tit_numero = numero (PK) tit_tipo_doc = tipoDocumento tbl_itulos_parcela (PK) tpa_parcela = parcela ...

13. Do we use Primary key of table as string type    forum.hibernate.org

14. How to manage primary key on a single string dbfield?    forum.hibernate.org

Hi all. I am new to this forum and I have been dealing with Hibernate, through Hibernate Synchronizer Eclipse plugin, since 2 weeks. I am developing a client server java app (no container) and I am dealing with an anagrafic-like table. My question is: what could be the proper hibernate-mapping for a primary key on a single string dbfield (string = ...

15. Primary Key made of 2 foreign keys and a date    forum.hibernate.org

16. null column as part of primary key    forum.hibernate.org

I have a database table that has no primary key defined. I cannot change the schema. But a combination of four columns can uniquely identify each record. The problem is that three of the columns could be null. Typical records are: ----------------------------- column1 column2 column3 column4 a001 null null null a001 b001 null null a001 b001 c001 null a001 b001 c001 ...





17. UserType for primary key used in an one-many    forum.hibernate.org

Author Message gemerick Post subject: UserType for primary key used in an one-many Posted: Mon May 01, 2006 11:00 am Newbie Joined: Thu Feb 17, 2005 10:49 am Posts: 6 I'm trying to map some existing code to a db with hibernate. There are only 2 objects: dcmobjectimpl and it's hashmap of metadata (map). The issue is that the ...

18. error: saving transient object, primary key inserted as null    forum.hibernate.org

Hi, I added the unsaved-value="null", but I'm still getting the same error, I've also tried the 'native' generator with no success. it's still trying to insert RecID with the query with the value null. Thanks Here's part of the .hbm.xml file that's generated: