Generate « Property « JPA Q&A

1. Generate value for a property in hibernate

I want to generate a unique guid/uuid value for a property which is not a primary key in hibernate. In other words, I want to generate values for an alternate primary ...

2. Hibernate: same generated value in two properties

I want the first to be generated:

@Column(name = "PRODUCT_ID", unique = true, nullable = false, precision = 12, 
        scale = 0)
@GeneratedValue(strategy = GenerationType.SEQUENCE, ...

3. Best practice for generated properties?

I do not want to use the primary key of my user table to reference a row from a user interface. So I wanted to add a public_id column generated (from an oracle sequence) on create, never updated, unique, non-nullable. However @Generated may only be used on @Id columns ( ... e/HHH-2907 ). I've seen someone offer the workaround of ...

5. unable to generate 'properties' with XDoclet

6. ID generated by trigger with multiple key properties

Hibernate version: 3.0.5 Database Oracle 9: I'm having the following problem: I want to insert records in a database that is using triggers to generate an ID for any records that are inserted to it. The trigger itself is using a sequence to generate the ID. So using a sequence with Hibernate does not work, since hibernate will have the wrong ...

7. Memory leak in AbstractBatcher with Generated Properties

Using Hibernate 3.2 GA with Entity Manager and Annotations, I have a batch job that inserts several thousands of objects for a class with a @Generated property. The job results in a memory leak in the AbstractBatcher class. The problem appears to be in the method processGeneratedProperties in AbstractEntityPersister. This method closes the result set for the generated property query and ...

8. Generated properties-lastModified property is not generated

I think you are misinterpreting what is meant by "generated properties" (as I did after the first reading). This does not mean that Hibernate generates the value for these properties (at insert or update time). It means, the database will do this - by executing a trigger which YOU must define. Carlo ---------------------------- please credit me if this helped you.

10. problem with generated properties

@Entity() @org.hibernate.annotations.Entity(selectBeforeUpdate=true) public class Blog { @Column( columnDefinition="Timestamp", insertable=false, updatable=false ) @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT) private Date dateAdded; //no ...