id « Test « JPA Q&A

1. DbUnit: problem with increment id generation

I am using DbUnit together with Unitils, which works great most of the time. Today I found a strange problem. Situation is:

  • I use Hibernate, and have id with "increment" ...

2. JPA - Different id generating strategy for tests

For production we are using a Oracle database with some fancy stuff for IDs

@GeneratedValue(generator = "generator")
@GenericGenerator(name = "generator", strategy = "guid", parameters = {})
private String propertyId;
For testing I thought I'd just ...

3. HQL test for entity id in collection on another entity

I am not sure how to express this so .. I have an entity A with a property called roleID (defined as Integer) where roleID is the PK of a Role entity. ...