Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 81940 invoked from network); 15 Mar 2007 20:06:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 20:06:48 -0000 Received: (qmail 45320 invoked by uid 500); 15 Mar 2007 20:06:55 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 45276 invoked by uid 500); 15 Mar 2007 20:06:55 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 45211 invoked by uid 99); 15 Mar 2007 20:06:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 13:06:54 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 13:06:42 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C3A871A9838; Thu, 15 Mar 2007 13:06:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r518744 [1/3] - in /geronimo/daytrader/branches/ejb3/modules: ejb/ ejb/src/main/java/org/apache/geronimo/samples/daytrader/ ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/ ejb/src/main/java/org/apache/geronimo/samples/daytrade... Date: Thu, 15 Mar 2007 20:06:20 -0000 To: scm@geronimo.apache.org From: cjblythe@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070315200621.C3A871A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cjblythe Date: Thu Mar 15 13:06:17 2007 New Revision: 518744 URL: http://svn.apache.org/viewvc?view=rev&rev=518744 Log: added ejb3 primitives and modified databean entity beans definitions/annotations Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3FacadeLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSFTestBean.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSFTestLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLTestBean.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLTestLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/QuoteFacade.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/QuoteFacadeLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/RemoteSFTestBean.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/RemoteSFTestRemote.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/RemoteSLTestBean.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/RemoteSLTestRemote.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/ResultHolder.java (with props) geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/ geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSFSessionRemoteCreate.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSFSessionRemoteRemove.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSFSessionRemoteUpdate.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionLocal2SLSessionRemote.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionLocalWithParameters.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionRemote.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionRemote2SLSessionLocal.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingSLSessionRemoteWithParameters.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EJBCreate.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EJBDestroy.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EJBUpdate.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToManyEager.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToManyLazy.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToManyToOneEager.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToManyToOneLazy.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToManyTrueEager.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToOneEager.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToOneLazy.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityOneToOneToMany.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/PingServlet2Session2MDB.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/ejb3/StaticUtils.java (with props) geronimo/daytrader/branches/ejb3/modules/web/src/main/webapp/ejb3_prims.html (with props) Modified: geronimo/daytrader/branches/ejb3/modules/ejb/pom.xml geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java geronimo/daytrader/branches/ejb3/modules/ejb/src/main/resources/META-INF/persistence.xml geronimo/daytrader/branches/ejb3/modules/web/pom.xml geronimo/daytrader/branches/ejb3/modules/web/src/main/webapp/WEB-INF/web.xml Modified: geronimo/daytrader/branches/ejb3/modules/ejb/pom.xml URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/pom.xml?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/pom.xml (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/pom.xml Thu Mar 15 13:06:17 2007 @@ -69,6 +69,18 @@ provided + org.apache.geronimo.specs + geronimo-ejb_3.0_spec + 1.0 + provided + + + org.apache.geronimo.specs + geronimo-annotation_1.0_spec + 1.0-M1 + provided + + commons-logging commons-logging provided Modified: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java Thu Mar 15 13:06:17 2007 @@ -21,41 +21,54 @@ import java.sql.Timestamp; import java.util.Collection; import java.util.Date; - import javax.ejb.EJBException; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.Version; -import javax.persistence.Table; -import javax.persistence.JoinColumn; -import javax.persistence.Column; -import javax.persistence.Transient; + +import javax.persistence.*; import org.apache.geronimo.samples.daytrader.util.Log; @Entity(name = "accountejb") @Table(name = "accountejb") +@NamedQueries( { + @NamedQuery(name = "accountejb.findByCreationdate", query = "SELECT a FROM accountejb a WHERE a.creationdate = :creationdate"), + @NamedQuery(name = "accountejb.findByOpenbalance", query = "SELECT a FROM accountejb a WHERE a.openbalance = :openbalance"), + @NamedQuery(name = "accountejb.findByLogoutcount", query = "SELECT a FROM accountejb a WHERE a.logoutcount = :logoutcount"), + @NamedQuery(name = "accountejb.findByBalance", query = "SELECT a FROM accountejb a WHERE a.balance = :balance"), + @NamedQuery(name = "accountejb.findByAccountid", query = "SELECT a FROM accountejb a WHERE a.accountid = :accountid"), + @NamedQuery(name = "accountejb.findByAccountid_eager", query = "SELECT a FROM accountejb a LEFT JOIN FETCH a.accountProfile WHERE a.accountid = :accountid"), + @NamedQuery(name = "accountejb.findByAccountid_eagerholdings", query = "SELECT a FROM accountejb a LEFT JOIN FETCH a.holdings WHERE a.accountid = :accountid"), + @NamedQuery(name = "accountejb.findByLastlogin", query = "SELECT a FROM accountejb a WHERE a.lastlogin = :lastlogin"), + @NamedQuery(name = "accountejb.findByLogincount", query = "SELECT a FROM accountejb a WHERE a.logincount = :logincount") + }) public class AccountDataBean implements Serializable { /* Accessor methods for persistent fields */ + @TableGenerator( + name="accountIdGen", + table="KEYGENEJB", + pkColumnName="KEYNAME", + valueColumnName="KEYVAL", + pkColumnValue="account", + allocationSize=1000) @Id - @GeneratedValue + @GeneratedValue(strategy=GenerationType.TABLE, + generator="accountIdGen") + @Column(nullable = false) private Integer accountID; /* accountID */ private int loginCount; /* loginCount */ private int logoutCount; /* logoutCount */ + @Temporal(TemporalType.TIMESTAMP) private Date lastLogin; /* lastLogin Date */ + @Temporal(TemporalType.TIMESTAMP) private Date creationDate; /* creationDate */ private BigDecimal balance; /* balance */ private BigDecimal openBalance; /* open balance */ - @OneToMany(mappedBy = "account", cascade = CascadeType.ALL) + @OneToMany(mappedBy = "account") private Collection orders; - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "PROFILE_USERID", referencedColumnName = "USERID") - @Column(length = 250) + @OneToMany(mappedBy = "account") + private Collection holdings; + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="PROFILE_USERID") private AccountProfileDataBean profile; // @Version // private Integer optLock; @@ -301,6 +314,14 @@ public void setOrders(Collection orders) { this.orders = orders; + } + + public Collection getHoldings() { + return holdings; + } + + public void setHoldings(Collection holdings) { + this.holdings = holdings; } public AccountProfileDataBean getProfile() { Modified: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java Thu Mar 15 13:06:17 2007 @@ -16,36 +16,33 @@ */ package org.apache.geronimo.samples.daytrader; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.OneToOne; -import javax.persistence.Version; -import javax.persistence.Table; -import javax.persistence.Column; +import javax.persistence.*; import org.apache.geronimo.samples.daytrader.util.Log; @Entity(name = "accountprofileejb") @Table(name = "accountprofileejb") +@NamedQueries( { + @NamedQuery(name = "accountprofileejb.findByAddress", query = "SELECT a FROM accountprofileejb a WHERE a.address = :address"), + @NamedQuery(name = "accountprofileejb.findByPasswd", query = "SELECT a FROM accountprofileejb a WHERE a.passwd = :passwd"), + @NamedQuery(name = "accountprofileejb.findByUserid", query = "SELECT a FROM accountprofileejb a WHERE a.userid = :userid"), + @NamedQuery(name = "accountprofileejb.findByEmail", query = "SELECT a FROM accountprofileejb a WHERE a.email = :email"), + @NamedQuery(name = "accountprofileejb.findByCreditcard", query = "SELECT a FROM accountprofileejb a WHERE a.creditcard = :creditcard"), + @NamedQuery(name = "accountprofileejb.findByFullname", query = "SELECT a FROM accountprofileejb a WHERE a.fullname = :fullname") + }) public class AccountProfileDataBean implements java.io.Serializable { /* Accessor methods for persistent fields */ @Id - @GeneratedValue - @Column(length=250) + //@GeneratedValue + @Column(nullable = false) private String userID; /* userID */ - @Column(length=250) private String passwd; /* password */ - @Column(length=250) private String fullName; /* fullName */ - @Column(length=250) private String address; /* address */ - @Column(length=250) private String email; /* email */ - @Column(length=250) private String creditCard; /* creditCard */ @OneToOne(mappedBy="profile") private AccountDataBean account; Modified: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java Thu Mar 15 13:06:17 2007 @@ -20,16 +20,8 @@ import java.math.BigDecimal; import java.util.Date; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Version; -import javax.persistence.Table; -import javax.persistence.Column; -import javax.persistence.Transient; +import javax.persistence.*; + import org.apache.geronimo.samples.daytrader.util.Log; @@ -44,18 +36,30 @@ /* persistent/relationship fields */ + @TableGenerator( + name="holdingIdGen", + table="KEYGENEJB", + pkColumnName="KEYNAME", + valueColumnName="KEYVAL", + pkColumnValue="holding", + allocationSize=1000) @Id - @GeneratedValue + @GeneratedValue(strategy=GenerationType.TABLE, + generator="holdingIdGen") + @Column(nullable = false) private Integer holdingID; /* holdingID */ private double quantity; /* quantity */ private BigDecimal purchasePrice; /* purchasePrice */ + @Temporal(TemporalType.TIMESTAMP) private Date purchaseDate; /* purchaseDate */ -// @Column(length = 250) @Transient private String quoteID; /* Holding(*) ---> Quote(1) */ - @OneToOne + + @ManyToOne + @JoinColumn(name="ACCOUNT_ACCOUNTID") private AccountDataBean account; - @OneToOne + @ManyToOne + @JoinColumn(name = "QUOTE_SYMBOL") private QuoteDataBean quote; // @Version Modified: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java Thu Mar 15 13:06:17 2007 @@ -21,17 +21,7 @@ import java.math.BigDecimal; import java.util.Date; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToOne; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Version; -import javax.persistence.Table; -import javax.persistence.Column; -import javax.persistence.Transient; +import javax.persistence.*; import org.apache.geronimo.samples.daytrader.util.Log; @@ -51,23 +41,35 @@ public class OrderDataBean implements Serializable { - @Id - @GeneratedValue + @TableGenerator( + name="orderIdGen", + table="KEYGENEJB", + pkColumnName="KEYNAME", + valueColumnName="KEYVAL", + pkColumnValue="order", + allocationSize=1000) + @Id + @GeneratedValue(strategy=GenerationType.TABLE, + generator="orderIdGen") + @Column(nullable = false) private Integer orderID; /* orderID */ - @Column(length=250) private String orderType; /* orderType (buy, sell, etc.) */ - @Column(length=250) private String orderStatus; /* orderStatus (open, processing, completed, closed, cancelled) */ + @Temporal(TemporalType.TIMESTAMP) private Date openDate; /* openDate (when the order was entered) */ + @Temporal(TemporalType.TIMESTAMP) private Date completionDate; /* completionDate */ private double quantity; /* quantity */ private BigDecimal price; /* price */ private BigDecimal orderFee; /* price */ @ManyToOne + @JoinColumn(name="ACCOUNT_ACCOUNTID") private AccountDataBean account; - @OneToOne + @ManyToOne + @JoinColumn(name="QUOTE_SYMBOL") private QuoteDataBean quote; @OneToOne + @JoinColumn(name = "HOLDING_HOLDINGID") private HoldingDataBean holding; // @Version // private Integer optLock; Modified: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java?view=diff&rev=518744&r1=518743&r2=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java (original) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java Thu Mar 15 13:06:17 2007 @@ -18,33 +18,35 @@ import java.io.Serializable; import java.math.BigDecimal; +import java.util.Collection; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Version; -import javax.persistence.Table; -import javax.persistence.Column; +import javax.persistence.*; import org.apache.geronimo.samples.daytrader.util.Log; @Entity(name = "quoteejb") @Table(name = "quoteejb") @NamedQueries({ -@NamedQuery(name = "allQuotes", - query = "SELECT q FROM quoteejb q"), -@NamedQuery(name = "quotesByChange", - query = "SELECT q FROM quoteejb q WHERE q.symbol LIKE 's:1__' ORDER BY q.change1 DESC") - }) + @NamedQuery(name = "allQuotes",query = "SELECT q FROM quoteejb q"), + @NamedQuery(name = "quotesByChange",query = "SELECT q FROM quoteejb q WHERE q.symbol LIKE 's:1__' ORDER BY q.change1 DESC"), + @NamedQuery(name = "quoteejb.findByLow", query = "SELECT q FROM quoteejb q WHERE q.low = :low"), + @NamedQuery(name = "quoteejb.findByOpen1", query = "SELECT q FROM quoteejb q WHERE q.open1 = :open1"), + @NamedQuery(name = "quoteejb.findByVolume", query = "SELECT q FROM quoteejb q WHERE q.volume = :volume"), + @NamedQuery(name = "quoteejb.findByPrice", query = "SELECT q FROM quoteejb q WHERE q.price = :price"), + @NamedQuery(name = "quoteejb.findByHigh", query = "SELECT q FROM quoteejb q WHERE q.high = :high"), + @NamedQuery(name = "quoteejb.findByCompanyname", query = "SELECT q FROM quoteejb q WHERE q.companyname = :companyname"), + @NamedQuery(name = "quoteejb.findBySymbol", query = "SELECT q FROM quoteejb q WHERE q.symbol = :symbol"), + @NamedQuery(name = "quoteejb.findByChange1", query = "SELECT q FROM quoteejb q WHERE q.change1 = :change1") +}) +@NamedNativeQueries({ + @NamedNativeQuery(name="quoteejb.quoteForUpdate", query="select * from quoteejb q where q.symbol=? for update",resultClass=org.apache.geronimo.samples.daytrader.QuoteDataBean.class) +}) public class QuoteDataBean implements Serializable { /* Accessor methods for persistent fields */ @Id - @Column(length = 250) private String symbol; /* symbol */ - @Column(length = 250) private String companyName; /* companyName */ private double volume; /* volume */ private BigDecimal price; /* price */ @@ -52,6 +54,8 @@ private BigDecimal low; /* low price */ private BigDecimal high; /* high price */ private double change1; /* price change */ + @OneToMany(mappedBy = "quote") + private Collection orders; // @Version // private Integer optLock; Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,250 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import org.apache.geronimo.samples.daytrader.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@Table(name = "ACCOUNTEJB") +public class Accountejb2 implements Serializable { + + @Column(name = "CREATIONDATE") + @Temporal(TemporalType.TIMESTAMP) + private Date creationDate; + + @Column(name = "OPENBALANCE") + private BigDecimal openBalance; + + @Column(name = "LOGOUTCOUNT", nullable = false) + private int logoutCount; + + @Column(name = "BALANCE") + private BigDecimal balance; + + @Id + @Column(name = "ACCOUNTID", nullable = false) + private Integer accountID; + + @Column(name = "LASTLOGIN") + @Temporal(TemporalType.TIMESTAMP) + private Date lastLogin; + + @Column(name = "LOGINCOUNT", nullable = false) + private int loginCount; + + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="PROFILE_USERID") + private AccountProfileDataBean profile; + + @OneToMany(mappedBy = "account", fetch=FetchType.EAGER) + private Collection holdings; + + /** Creates a new instance of Accountejb */ + public Accountejb2() { + } + + /** + * Creates a new instance of Accountejb with the specified values. + * @param accountid the accountid of the Accountejb + */ + public Accountejb2(Integer accountid) { + this.accountID = accountid; + } + + /** + * Creates a new instance of Accountejb with the specified values. + * @param accountid the accountid of the Accountejb + * @param logoutcount the logoutcount of the Accountejb + * @param logincount the logincount of the Accountejb + */ + public Accountejb2(Integer accountid, int logoutcount, int logincount) { + this.accountID = accountid; + this.logoutCount = logoutcount; + this.loginCount = logincount; + } + + /** + * Gets the creationdate of this Accountejb. + * @return the creationdate + */ + public Date getCreationDate() { + return this.creationDate; + } + + /** + * Sets the creationdate of this Accountejb to the specified value. + * @param creationdate the new creationdate + */ + public void setCreationDate(Date creationdate) { + this.creationDate = creationdate; + } + + /** + * Gets the openbalance of this Accountejb. + * @return the openbalance + */ + public BigDecimal getOpenBalance() { + return this.openBalance; + } + + /** + * Sets the openbalance of this Accountejb to the specified value. + * @param openbalance the new openbalance + */ + public void setOpenbalance(BigDecimal openbalance) { + this.openBalance = openbalance; + } + + /** + * Gets the logoutcount of this Accountejb. + * @return the logoutcount + */ + public int getLogoutCount() { + return this.logoutCount; + } + + /** + * Sets the logoutcount of this Accountejb to the specified value. + * @param logoutcount the new logoutcount + */ + public void setLogoutcount(int logoutcount) { + this.logoutCount = logoutcount; + } + + /** + * Gets the balance of this Accountejb. + * @return the balance + */ + public BigDecimal getBalance() { + return this.balance; + } + + /** + * Sets the balance of this Accountejb to the specified value. + * @param balance the new balance + */ + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + /** + * Gets the accountid of this Accountejb. + * @return the accountid + */ + public Integer getAccountID() { + return this.accountID; + } + + /** + * Sets the accountid of this Accountejb to the specified value. + * @param accountid the new accountid + */ + public void setAccountID(Integer accountid) { + this.accountID = accountid; + } + + /** + * Gets the lastlogin of this Accountejb. + * @return the lastlogin + */ + public Date getLastLogin() { + return this.lastLogin; + } + + /** + * Sets the lastlogin of this Accountejb to the specified value. + * @param lastlogin the new lastlogin + */ + public void setLastLogin(Date lastlogin) { + this.lastLogin = lastlogin; + } + + /** + * Gets the logincount of this Accountejb. + * @return the logincount + */ + public int getLoginCount() { + return this.loginCount; + } + + /** + * Sets the logincount of this Accountejb to the specified value. + * @param logincount the new logincount + */ + public void setLoginCount(int logincount) { + this.loginCount = logincount; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.accountID != null ? this.accountID.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Accountejb. The result is + * true if and only if the argument is not null and is a Accountejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Accountejb2)) { + return false; + } + Accountejb2 other = (Accountejb2)object; + if (this.accountID != other.accountID && (this.accountID == null || !this.accountID.equals(other.accountID))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Accountejb2[accountid=" + accountID + "]"; + } + + public AccountProfileDataBean getProfile() { + return profile; + } + + public void setProfile(AccountProfileDataBean accountProfile) { + this.profile = accountProfile; + } + + public Collection getHoldings() { + return holdings; + } + + public void setHoldings(Collection holdings2) { + this.holdings = holdings2; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb2.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,248 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import org.apache.geronimo.samples.daytrader.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@Table(name = "ACCOUNTEJB") +public class Accountejb3 implements Serializable { + + @Column(name = "CREATIONDATE") + @Temporal(TemporalType.TIMESTAMP) + private Date creationDate; + + @Column(name = "OPENBALANCE") + private BigDecimal openBalance; + + @Column(name = "LOGOUTCOUNT", nullable = false) + private int logoutCount; + + @Column(name = "BALANCE") + private BigDecimal balance; + + @Id + @Column(name = "ACCOUNTID", nullable = false) + private Integer accountID; + + @Column(name = "LASTLOGIN") + @Temporal(TemporalType.TIMESTAMP) + private Date lastLogin; + + @Column(name = "LOGINCOUNT", nullable = false) + private int loginCount; + + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="PROFILE_USERID") + private AccountProfileDataBean profile; + + @OneToMany(mappedBy = "account", fetch=FetchType.EAGER) + private Collection holdings3; + + /** Creates a new instance of Accountejb */ + public Accountejb3() { + } + + /** + * Creates a new instance of Accountejb with the specified values. + * @param accountid the accountid of the Accountejb + */ + public Accountejb3(Integer accountid) { + this.accountID = accountid; + } + + /** + * Creates a new instance of Accountejb with the specified values. + * @param accountid the accountid of the Accountejb + * @param logoutcount the logoutcount of the Accountejb + * @param logincount the logincount of the Accountejb + */ + public Accountejb3(Integer accountid, int logoutcount, int logincount) { + this.accountID = accountid; + this.logoutCount = logoutcount; + this.loginCount = logincount; + } + + /** + * Gets the creationdate of this Accountejb. + * @return the creationdate + */ + public Date getCreationDate() { + return this.creationDate; + } + + /** + * Sets the creationdate of this Accountejb to the specified value. + * @param creationdate the new creationdate + */ + public void setCreationDate(Date creationdate) { + this.creationDate = creationdate; + } + + /** + * Gets the openbalance of this Accountejb. + * @return the openbalance + */ + public BigDecimal getOpenBalance() { + return this.openBalance; + } + + /** + * Sets the openbalance of this Accountejb to the specified value. + * @param openbalance the new openbalance + */ + public void setOpenBalance(BigDecimal openbalance) { + this.openBalance = openbalance; + } + + /** + * Gets the logoutcount of this Accountejb. + * @return the logoutcount + */ + public int getLogoutCount() { + return this.logoutCount; + } + + /** + * Sets the logoutcount of this Accountejb to the specified value. + * @param logoutcount the new logoutcount + */ + public void setLogoutCount(int logoutcount) { + this.logoutCount = logoutcount; + } + + /** + * Gets the balance of this Accountejb. + * @return the balance + */ + public BigDecimal getBalance() { + return this.balance; + } + + /** + * Sets the balance of this Accountejb to the specified value. + * @param balance the new balance + */ + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + /** + * Gets the accountid of this Accountejb. + * @return the accountid + */ + public Integer getAccountID() { + return this.accountID; + } + + /** + * Sets the accountid of this Accountejb to the specified value. + * @param accountid the new accountid + */ + public void setAccountID(Integer accountid) { + this.accountID = accountid; + } + + /** + * Gets the lastlogin of this Accountejb. + * @return the lastlogin + */ + public Date getLastLogin() { + return this.lastLogin; + } + + /** + * Sets the lastlogin of this Accountejb to the specified value. + * @param lastlogin the new lastlogin + */ + public void setLastLogin(Date lastlogin) { + this.lastLogin = lastLogin; + } + + /** + * Gets the logincount of this Accountejb. + * @return the logincount + */ + public int getLoginCount() { + return this.loginCount; + } + + /** + * Sets the logincount of this Accountejb to the specified value. + * @param logincount the new logincount + */ + public void setLoginCount(int logincount) { + this.loginCount = logincount; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.accountID != null ? this.accountID.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Accountejb. The result is + * true if and only if the argument is not null and is a Accountejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Accountejb3)) { + return false; + } + Accountejb3 other = (Accountejb3)object; + if (this.accountID != other.accountID && (this.accountID == null || !this.accountID.equals(other.accountID))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Accountejb3[accountid=" + accountID + "]"; + } + + public AccountProfileDataBean getProfile() { + return profile; + } + + public void setProfile(AccountProfileDataBean accountProfile) { + this.profile = accountProfile; + } + + public Collection getHoldings() { + return holdings3; + } + + public void setHoldings(Collection holdings3) { + this.holdings3 = holdings3; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Accountejb3.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,179 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name = "HOLDINGEJB") +public class Holdingejb2 implements Serializable { + + @Column(name = "PURCHASEPRICE") + private BigDecimal purchasePrice; + + @Id + @Column(name = "HOLDINGID", nullable = false) + private Integer holdingID; + + @Column(name = "QUANTITY", nullable = false) + private double quantity; + + @Column(name = "PURCHASEDATE") + @Temporal(TemporalType.TIMESTAMP) + private Date purchaseDate; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "QUOTE_SYMBOL") + private Quoteejb2 quote; + + @ManyToOne + @JoinColumn(name="ACCOUNT_ACCOUNTID") + private Accountejb2 account; + + /** Creates a new instance of Holdingejb */ + public Holdingejb2() { + } + + /** + * Creates a new instance of Holdingejb with the specified values. + * @param holdingid the holdingid of the Holdingejb + */ + public Holdingejb2(Integer holdingid) { + this.holdingID = holdingid; + } + + /** + * Creates a new instance of Holdingejb with the specified values. + * @param holdingid the holdingid of the Holdingejb + * @param quantity the quantity of the Holdingejb + */ + public Holdingejb2(Integer holdingid, double quantity) { + this.holdingID = holdingid; + this.quantity = quantity; + } + + /** + * Gets the purchaseprice of this Holdingejb. + * @return the purchaseprice + */ + public BigDecimal getPurchasePrice() { + return this.purchasePrice; + } + + /** + * Sets the purchaseprice of this Holdingejb to the specified value. + * @param purchaseprice the new purchaseprice + */ + public void setPurchasePrice(BigDecimal purchaseprice) { + this.purchasePrice = purchaseprice; + } + + /** + * Gets the holdingid of this Holdingejb. + * @return the holdingid + */ + public Integer getHoldingID() { + return this.holdingID; + } + + /** + * Sets the holdingid of this Holdingejb to the specified value. + * @param holdingid the new holdingid + */ + public void setHoldingID(Integer holdingid) { + this.holdingID = holdingid; + } + + /** + * Gets the quantity of this Holdingejb. + * @return the quantity + */ + public double getQuantity() { + return this.quantity; + } + + /** + * Sets the quantity of this Holdingejb to the specified value. + * @param quantity the new quantity + */ + public void setQuantity(double quantity) { + this.quantity = quantity; + } + + /** + * Gets the purchasedate of this Holdingejb. + * @return the purchasedate + */ + public Date getPurchaseDate() { + return this.purchaseDate; + } + + /** + * Sets the purchasedate of this Holdingejb to the specified value. + * @param purchasedate the new purchasedate + */ + public void setPurchaseDate(Date purchasedate) { + this.purchaseDate = purchasedate; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.holdingID != null ? this.holdingID.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Holdingejb. The result is + * true if and only if the argument is not null and is a Holdingejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Holdingejb2)) { + return false; + } + Holdingejb2 other = (Holdingejb2)object; + if (this.holdingID != other.holdingID && (this.holdingID == null || !this.holdingID.equals(other.holdingID))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Holdingejb2[holdingid=" + holdingID + "]"; + } + + public Quoteejb2 getQuote() { + return quote; + } + + public void setQuote(Quoteejb2 quote) { + this.quote = quote; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb2.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,178 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@Table(name = "HOLDINGEJB") +public class Holdingejb3 implements Serializable { + + @Column(name = "PURCHASEPRICE") + private BigDecimal purchasePrice; + + @Id + @Column(name = "HOLDINGID", nullable = false) + private Integer holdingID; + + @Column(name = "QUANTITY", nullable = false) + private double quantity; + + @Column(name = "PURCHASEDATE") + @Temporal(TemporalType.TIMESTAMP) + private Date purchaseDate; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "QUOTE_SYMBOL") + private Quoteejb3 quote; + + @ManyToOne + @JoinColumn(name="ACCOUNT_ACCOUNTID") + private Accountejb3 account; + + /** Creates a new instance of Holdingejb */ + public Holdingejb3() { + } + + /** + * Creates a new instance of Holdingejb with the specified values. + * @param holdingid the holdingid of the Holdingejb + */ + public Holdingejb3(Integer holdingid) { + this.holdingID = holdingid; + } + + /** + * Creates a new instance of Holdingejb with the specified values. + * @param holdingid the holdingid of the Holdingejb + * @param quantity the quantity of the Holdingejb + */ + public Holdingejb3(Integer holdingid, double quantity) { + this.holdingID = holdingid; + this.quantity = quantity; + } + + /** + * Gets the purchaseprice of this Holdingejb. + * @return the purchaseprice + */ + public BigDecimal getPurchasePrice() { + return this.purchasePrice; + } + + /** + * Sets the purchaseprice of this Holdingejb to the specified value. + * @param purchaseprice the new purchaseprice + */ + public void setPurchasePrice(BigDecimal purchaseprice) { + this.purchasePrice = purchaseprice; + } + + /** + * Gets the holdingid of this Holdingejb. + * @return the holdingid + */ + public Integer getHoldingID() { + return this.holdingID; + } + + /** + * Sets the holdingid of this Holdingejb to the specified value. + * @param holdingid the new holdingid + */ + public void setHoldingID(Integer holdingid) { + this.holdingID = holdingid; + } + + /** + * Gets the quantity of this Holdingejb. + * @return the quantity + */ + public double getQuantity() { + return this.quantity; + } + + /** + * Sets the quantity of this Holdingejb to the specified value. + * @param quantity the new quantity + */ + public void setQuantity(double quantity) { + this.quantity = quantity; + } + + /** + * Gets the purchasedate of this Holdingejb. + * @return the purchasedate + */ + public Date getPurchaseDate() { + return this.purchaseDate; + } + + /** + * Sets the purchasedate of this Holdingejb to the specified value. + * @param purchasedate the new purchasedate + */ + public void setPurchaseDate(Date purchasedate) { + this.purchaseDate = purchasedate; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.holdingID != null ? this.holdingID.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Holdingejb. The result is + * true if and only if the argument is not null and is a Holdingejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Holdingejb3)) { + return false; + } + Holdingejb3 other = (Holdingejb3)object; + if (this.holdingID != other.holdingID && (this.holdingID == null || !this.holdingID.equals(other.holdingID))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Holdingejb3[holdingid=" + holdingID + "]"; + } + + public Quoteejb3 getQuote() { + return quote; + } + + public void setQuote(Quoteejb3 quote) { + this.quote = quote; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Holdingejb3.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,233 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + + +@Entity +@Table(name = "QUOTEEJB") +public class Quoteejb2 implements Serializable { + + @Column(name = "LOW") + private BigDecimal low; + + @Column(name = "OPEN1") + private BigDecimal open; + + @Column(name = "VOLUME", nullable = false) + private double volume; + + @Column(name = "PRICE") + private BigDecimal price; + + @Column(name = "HIGH") + private BigDecimal high; + + @Column(name = "COMPANYNAME") + private String companyName; + + @Id + @Column(name = "SYMBOL", nullable = false) + private String symbol; + + @Column(name = "CHANGE1", nullable = false) + private double change; + + /** Creates a new instance of Quoteejb */ + public Quoteejb2() { + } + + /** + * Creates a new instance of Quoteejb with the specified values. + * @param symbol the symbol of the Quoteejb + */ + public Quoteejb2(String symbol) { + this.symbol = symbol; + } + + /** + * Creates a new instance of Quoteejb with the specified values. + * @param symbol the symbol of the Quoteejb + * @param volume the volume of the Quoteejb + * @param change1 the change1 of the Quoteejb + */ + public Quoteejb2(String symbol, double volume, double change1) { + this.symbol = symbol; + this.volume = volume; + this.change = change1; + } + + /** + * Gets the low of this Quoteejb. + * @return the low + */ + public BigDecimal getLow() { + return this.low; + } + + /** + * Sets the low of this Quoteejb to the specified value. + * @param low the new low + */ + public void setLow(BigDecimal low) { + this.low = low; + } + + /** + * Gets the open1 of this Quoteejb. + * @return the open1 + */ + public BigDecimal getOpen() { + return this.open; + } + + /** + * Sets the open1 of this Quoteejb to the specified value. + * @param open1 the new open1 + */ + public void setOpen(BigDecimal open1) { + this.open = open1; + } + + /** + * Gets the volume of this Quoteejb. + * @return the volume + */ + public double getVolume() { + return this.volume; + } + + /** + * Sets the volume of this Quoteejb to the specified value. + * @param volume the new volume + */ + public void setVolume(double volume) { + this.volume = volume; + } + + /** + * Gets the price of this Quoteejb. + * @return the price + */ + public BigDecimal getPrice() { + return this.price; + } + + /** + * Sets the price of this Quoteejb to the specified value. + * @param price the new price + */ + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + * Gets the high of this Quoteejb. + * @return the high + */ + public BigDecimal getHigh() { + return this.high; + } + + /** + * Sets the high of this Quoteejb to the specified value. + * @param high the new high + */ + public void setHigh(BigDecimal high) { + this.high = high; + } + + /** + * Gets the companyname of this Quoteejb. + * @return the companyname + */ + public String getCompanyName() { + return this.companyName; + } + + /** + * Sets the companyname of this Quoteejb to the specified value. + * @param companyname the new companyname + */ + public void setCompanyName(String companyname) { + this.companyName = companyname; + } + + /** + * Gets the symbol of this Quoteejb. + * @return the symbol + */ + public String getSymbol() { + return this.symbol; + } + + /** + * Sets the symbol of this Quoteejb to the specified value. + * @param symbol the new symbol + */ + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + /** + * Gets the change1 of this Quoteejb. + * @return the change1 + */ + public double getChange() { + return this.change; + } + + /** + * Sets the change1 of this Quoteejb to the specified value. + * @param change1 the new change1 + */ + public void setChange(double change1) { + this.change = change1; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.symbol != null ? this.symbol.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Quoteejb. The result is + * true if and only if the argument is not null and is a Quoteejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Quoteejb2)) { + return false; + } + Quoteejb2 other = (Quoteejb2)object; + if (this.symbol != other.symbol && (this.symbol == null || !this.symbol.equals(other.symbol))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Quoteejb2[symbol=" + symbol + "]"; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb2.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,237 @@ +package org.apache.geronimo.samples.daytrader.ejb3; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * Entity class Quoteejb3 + * + * @author Rob + */ +@Entity +@Table(name = "QUOTEEJB") +public class Quoteejb3 implements Serializable { + + @Column(name = "LOW") + private BigDecimal low; + + @Column(name = "OPEN1") + private BigDecimal open; + + @Column(name = "VOLUME", nullable = false) + private double volume; + + @Column(name = "PRICE") + private BigDecimal price; + + @Column(name = "HIGH") + private BigDecimal high; + + @Column(name = "COMPANYNAME") + private String companyName; + + @Id + @Column(name = "SYMBOL", nullable = false) + private String symbol; + + @Column(name = "CHANGE1", nullable = false) + private double change; + + /** Creates a new instance of Quoteejb */ + public Quoteejb3() { + } + + /** + * Creates a new instance of Quoteejb with the specified values. + * @param symbol the symbol of the Quoteejb + */ + public Quoteejb3(String symbol) { + this.symbol = symbol; + } + + /** + * Creates a new instance of Quoteejb with the specified values. + * @param symbol the symbol of the Quoteejb + * @param volume the volume of the Quoteejb + * @param change1 the change1 of the Quoteejb + */ + public Quoteejb3(String symbol, double volume, double change1) { + this.symbol = symbol; + this.volume = volume; + this.change = change1; + } + + /** + * Gets the low of this Quoteejb. + * @return the low + */ + public BigDecimal getLow() { + return this.low; + } + + /** + * Sets the low of this Quoteejb to the specified value. + * @param low the new low + */ + public void setLow(BigDecimal low) { + this.low = low; + } + + /** + * Gets the open1 of this Quoteejb. + * @return the open1 + */ + public BigDecimal getOpen() { + return this.open; + } + + /** + * Sets the open1 of this Quoteejb to the specified value. + * @param open1 the new open1 + */ + public void setOpen(BigDecimal open1) { + this.open = open1; + } + + /** + * Gets the volume of this Quoteejb. + * @return the volume + */ + public double getVolume() { + return this.volume; + } + + /** + * Sets the volume of this Quoteejb to the specified value. + * @param volume the new volume + */ + public void setVolume(double volume) { + this.volume = volume; + } + + /** + * Gets the price of this Quoteejb. + * @return the price + */ + public BigDecimal getPrice() { + return this.price; + } + + /** + * Sets the price of this Quoteejb to the specified value. + * @param price the new price + */ + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + * Gets the high of this Quoteejb. + * @return the high + */ + public BigDecimal getHigh() { + return this.high; + } + + /** + * Sets the high of this Quoteejb to the specified value. + * @param high the new high + */ + public void setHigh(BigDecimal high) { + this.high = high; + } + + /** + * Gets the companyname of this Quoteejb. + * @return the companyname + */ + public String getCompanyName() { + return this.companyName; + } + + /** + * Sets the companyname of this Quoteejb to the specified value. + * @param companyname the new companyname + */ + public void setCompanyName(String companyname) { + this.companyName = companyname; + } + + /** + * Gets the symbol of this Quoteejb. + * @return the symbol + */ + public String getSymbol() { + return this.symbol; + } + + /** + * Sets the symbol of this Quoteejb to the specified value. + * @param symbol the new symbol + */ + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + /** + * Gets the change1 of this Quoteejb. + * @return the change1 + */ + public double getChange() { + return this.change; + } + + /** + * Sets the change1 of this Quoteejb to the specified value. + * @param change1 the new change1 + */ + public void setChange(double change1) { + this.change = change1; + } + + /** + * Returns a hash code value for the object. This implementation computes + * a hash code value based on the id fields in this object. + * @return a hash code value for this object. + */ + @Override + public int hashCode() { + int hash = 0; + hash += (this.symbol != null ? this.symbol.hashCode() : 0); + return hash; + } + + /** + * Determines whether another object is equal to this Quoteejb. The result is + * true if and only if the argument is not null and is a Quoteejb object that + * has the same id field values as this object. + * @param object the reference object with which to compare + * @return true if this object is the same as the argument; + * false otherwise. + */ + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Quoteejb3)) { + return false; + } + Quoteejb3 other = (Quoteejb3)object; + if (this.symbol != other.symbol && (this.symbol == null || !this.symbol.equals(other.symbol))) return false; + return true; + } + + /** + * Returns a string representation of the object. This implementation constructs + * that representation based on the id fields. + * @return a string representation of the object. + */ + @Override + public String toString() { + return "org.apache.geronimo.samples.daytrader.ejb3.Quoteejb3[symbol=" + symbol + "]"; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/Quoteejb3.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,69 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.*; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; + +@Stateless +public class AccountFacade implements AccountFacadeLocal { + + @PersistenceContext + private EntityManager em; + + /** Creates a new instance of AccountDataBeanFacade */ + public AccountFacade() { + } + + public void create(AccountDataBean account) { + em.persist(account); + } + + public void edit(AccountDataBean account) { + em.merge(account); + } + + public void destroy(AccountDataBean account) { + em.merge(account); + em.remove(account); + } + + public AccountDataBean find(Object pk) { + return (AccountDataBean) em.find(AccountDataBean.class, pk); + } + + public List findAll() { + return em.createQuery("select object(o) from accountejb as o").getResultList(); + } + + public AccountDataBean findByAccountID(Integer key, boolean lazy){ + Query q = null; + if (lazy) { + q = em.createNamedQuery("accountejb.findByAccountid"); + } else { + q = em.createNamedQuery("accountejb.findByAccountid_eager"); + } + + q.setParameter("accountid", key); + + return (AccountDataBean)q.getSingleResult(); + } + + + public AccountDataBean findByAccountIDEagerHoldings(Integer key){ + Query q = null; + q = em.createNamedQuery("accountejb.findByAccountid_eagerholdings"); + + q.setParameter("accountid", key); + + List l = q.getResultList(); + AccountDataBean ae = (AccountDataBean)l.get(0); + + return ae; + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacade.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,23 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.*; +import java.util.List; +import javax.ejb.Local; + +@Local +public interface AccountFacadeLocal { + void create(AccountDataBean account); + + void edit(AccountDataBean account); + + void destroy(AccountDataBean account); + + AccountDataBean find(Object pk); + + AccountDataBean findByAccountID(Integer key, boolean lazy); + + List findAll(); + + AccountDataBean findByAccountIDEagerHoldings(Integer key); + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountFacadeLocal.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,41 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.*; +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + + +@Stateless +public class AccountProfileFacade implements AccountProfileFacadeLocal { + + @PersistenceContext + private EntityManager em; + + /** Creates a new instance of AccountProfileDataBeanFacade */ + public AccountProfileFacade() { + } + + public void create(AccountProfileDataBean profile) { + em.persist(profile); + } + + public void edit(AccountProfileDataBean profile) { + em.merge(profile); + } + + public void destroy(AccountProfileDataBean profile) { + em.merge(profile); + em.remove(profile); + } + + public AccountProfileDataBean find(Object pk) { + return (AccountProfileDataBean) em.find(AccountProfileDataBean.class, pk); + } + + public List findAll() { + return em.createQuery("select object(o) from accountprofileejb as o").getResultList(); + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacade.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,20 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.*; +import java.util.List; +import javax.ejb.Local; + + +@Local +public interface AccountProfileFacadeLocal { + void create(AccountProfileDataBean profile); + + void edit(AccountProfileDataBean profile); + + void destroy(AccountProfileDataBean profile); + + AccountProfileDataBean find(Object pk); + + List findAll(); + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/AccountProfileFacadeLocal.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,41 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.ejb3.Accountejb2; +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + + +@Stateless +public class Accountejb2Facade implements Accountejb2FacadeLocal { + + @PersistenceContext + private EntityManager em; + + /** Creates a new instance of Accountejb2Facade */ + public Accountejb2Facade() { + } + + public void create(Accountejb2 accountejb2) { + em.persist(accountejb2); + } + + public void edit(Accountejb2 accountejb2) { + em.merge(accountejb2); + } + + public void destroy(Accountejb2 accountejb2) { + em.merge(accountejb2); + em.remove(accountejb2); + } + + public Accountejb2 find(Object pk) { + return (Accountejb2) em.find(Accountejb2.class, pk); + } + + public List findAll() { + return em.createQuery("select object(o) from Accountejb2 as o").getResultList(); + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2Facade.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,23 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.ejb3.Accountejb2; +import java.util.List; +import javax.ejb.Local; + +/** + * + * @author Rob + */ +@Local +public interface Accountejb2FacadeLocal { + void create(Accountejb2 accountejb2); + + void edit(Accountejb2 accountejb2); + + void destroy(Accountejb2 accountejb2); + + Accountejb2 find(Object pk); + + List findAll(); + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb2FacadeLocal.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java?view=auto&rev=518744 ============================================================================== --- geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java (added) +++ geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java Thu Mar 15 13:06:17 2007 @@ -0,0 +1,44 @@ +package org.apache.geronimo.samples.daytrader.ejb3.prims; + +import org.apache.geronimo.samples.daytrader.ejb3.Accountejb3; +import org.apache.geronimo.samples.daytrader.ejb3.Holdingejb3; +import java.util.Iterator; +import java.util.List; +import java.util.Collection; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + + +@Stateless +public class Accountejb3Facade implements Accountejb3FacadeLocal { + + @PersistenceContext + private EntityManager em; + + /** Creates a new instance of Accountejb3Facade */ + public Accountejb3Facade() { + } + + public void create(Accountejb3 accountejb3) { + em.persist(accountejb3); + } + + public void edit(Accountejb3 accountejb3) { + em.merge(accountejb3); + } + + public void destroy(Accountejb3 accountejb3) { + em.merge(accountejb3); + em.remove(accountejb3); + } + + public Accountejb3 find(Object pk) { + return (Accountejb3) em.find(Accountejb3.class, pk); + } + + public List findAll() { + return em.createQuery("select object(o) from Accountejb3 as o").getResultList(); + } + +} Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/daytrader/branches/ejb3/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/Accountejb3Facade.java ------------------------------------------------------------------------------ svn:mime-type = text/plain