/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.test.annotations.onetomany; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * @author Brett Meyer */ @Entity // "Transaction" reserved in some Dialects @Table( name = "BankTransaction" ) public class Transaction { @Id @GeneratedValue private long id; private String code; @ManyToOne( cascade = { CascadeType.ALL } ) private BankAccount account; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public BankAccount getAccount() { return account; } public void setAccount(BankAccount account) { this.account = account; } }