Skip to content

Instantly share code, notes, and snippets.

@MarkMenard
Created March 22, 2010 21:05
Show Gist options
  • Save MarkMenard/340526 to your computer and use it in GitHub Desktop.
Save MarkMenard/340526 to your computer and use it in GitHub Desktop.
Example Groovy JPA
package models
import javax.persistence.*
@Entity (name="Agreement")
@Table (name="agreement")
@EntityListeners ([QIdSetter.class])
class AgreementJpaImpl extends QIdEntityImpl implements Agreement {
@ManyToOne (targetEntity=PartyJpaImpl.class)
Party party
@OneToMany (targetEntity=AgreementLineItemJpaImpl.class, mappedBy="agreement")
Set<AgreementLineItem> agreementLineItems = new HashSet<AgreementLineItem> ()
public AgreementJpaImpl () {
super()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment