01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.ejb3.test.clusteredentity.classloader;
23:
24: import java.io.Serializable;
25:
26: import javax.persistence.Entity;
27: import javax.persistence.Id;
28: import javax.persistence.Lob;
29: import javax.persistence.NamedQueries;
30: import javax.persistence.NamedQuery;
31: import javax.persistence.QueryHint;
32:
33: import org.hibernate.annotations.Cache;
34: import org.hibernate.annotations.CacheConcurrencyStrategy;
35:
36: /**
37: * Comment
38: *
39: * @author Brian Stansberry
40: * @version $Revision: 60233 $
41: */
42: @Entity
43: @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
44: @NamedQueries({@NamedQuery(name="account.totalbalance.default",query="select account.balance from Account as account where account.accountHolder = ?1",hints={@QueryHint(name="org.hibernate.cacheable",value="true")}),@NamedQuery(name="account.totalbalance.namedregion",query="select account.balance from Account as account where account.accountHolder = ?1",hints={@QueryHint(name="org.hibernate.cacheRegion",value="AccountRegion"),@QueryHint(name="org.hibernate.cacheable",value="true")}),@NamedQuery(name="account.branch.default",query="select account.branch from Account as account where account.accountHolder = ?1",hints={@QueryHint(name="org.hibernate.cacheable",value="true")}),@NamedQuery(name="account.branch.namedregion",query="select account.branch from Account as account where account.accountHolder = ?1",hints={@QueryHint(name="org.hibernate.cacheRegion",value="AccountRegion"),@QueryHint(name="org.hibernate.cacheable",value="true")}),@NamedQuery(name="account.bybranch.default",query="select account from Account as account where account.branch = ?1",hints={@QueryHint(name="org.hibernate.cacheable",value="true")}),@NamedQuery(name="account.bybranch.namedregion",query="select account from Account as account where account.branch = ?1",hints={@QueryHint(name="org.hibernate.cacheRegion",value="AccountRegion"),@QueryHint(name="org.hibernate.cacheable",value="true")})})
45: public class Account implements Serializable {
46:
47: private static final long serialVersionUID = 1L;
48:
49: private Integer id;
50: private AccountHolderPK accountHolder;
51: private Integer balance;
52: private String branch;
53:
54: @Id
55: public Integer getId() {
56: return id;
57: }
58:
59: public void setId(Integer id) {
60: this .id = id;
61: }
62:
63: // @Embedded
64: @Lob
65: public AccountHolderPK getAccountHolder() {
66: return accountHolder;
67: }
68:
69: public void setAccountHolder(AccountHolderPK accountHolder) {
70: this .accountHolder = accountHolder;
71: }
72:
73: public Integer getBalance() {
74: return balance;
75: }
76:
77: public void setBalance(Integer balance) {
78: this .balance = balance;
79: }
80:
81: public String getBranch() {
82: return branch;
83: }
84:
85: public void setBranch(String branch) {
86: this.branch = branch;
87: }
88:
89: }
|