geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjbly...@apache.org
Subject svn commit: r559534 - in /geronimo/daytrader/trunk: modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/ modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ej...
Date Wed, 25 Jul 2007 17:44:02 GMT
Author: cjblythe
Date: Wed Jul 25 10:44:00 2007
New Revision: 559534

URL: http://svn.apache.org/viewvc?view=rev&rev=559534
Log:
Committed the following updates necessary to provide a full EJB 3 mode.

Modified:
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeConfig.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeJPA.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java
    geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
    geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml
    geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml
    geronimo/daytrader/trunk/plans/daytrader-g-2.0-SNAPSHOT-plan.xml

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountDataBean.java Wed Jul 25 10:44:00 2007
@@ -30,15 +30,15 @@
 @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.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")
+        @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.profile 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 {
 
@@ -51,25 +51,40 @@
             pkColumnValue="account",
             allocationSize=1000)
     @Id
-    @GeneratedValue(strategy=GenerationType.TABLE,
-            generator="accountIdGen")
-    @Column(nullable = false)
-    private Integer accountID;         /* accountID */
-    private int loginCount;     /* loginCount */
-    private int logoutCount;     /* logoutCount */
+    @GeneratedValue(strategy=GenerationType.TABLE, generator="accountIdGen")
+    @Column(name = "ACCOUNTID", nullable = false)
+    private Integer accountID;              /* accountID */
+    
+    @Column(name = "LOGINCOUNT", nullable = false)
+    private int loginCount;                 /* loginCount */
+    
+    @Column(name = "LOGOUTCOUNT", nullable = false)
+    private int logoutCount;                /* logoutCount */
+    
+    @Column(name = "LASTLOGIN")
     @Temporal(TemporalType.TIMESTAMP)
-    private Date lastLogin;         /* lastLogin Date */
+    private Date lastLogin;                 /* lastLogin Date */
+    
+    @Column(name = "CREATIONDATE")
     @Temporal(TemporalType.TIMESTAMP)
-    private Date creationDate;     /* creationDate */
-    private BigDecimal balance;         /* balance */
-    private BigDecimal openBalance;     /* open balance */
-    @OneToMany(mappedBy = "account")
+    private Date creationDate;              /* creationDate */
+    
+    @Column(name = "BALANCE")
+    private BigDecimal balance;             /* balance */
+    
+    @Column(name = "OPENBALANCE")
+    private BigDecimal openBalance;         /* open balance */
+    
+    @OneToMany(mappedBy = "account", fetch=FetchType.LAZY)
     private Collection<OrderDataBean> orders;
-    @OneToMany(mappedBy = "account")
+    
+    @OneToMany(mappedBy = "account", fetch=FetchType.LAZY)
     private Collection<HoldingDataBean> holdings;
+    
     @OneToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="PROFILE_USERID")
     private AccountProfileDataBean profile;
+
 //    @Version
 //    private Integer optLock;
 
@@ -154,160 +169,76 @@
         Log.log(this.toString());
     }
 
-    /**
-     * Gets the accountID
-     *
-     * @return Returns a Integer
-     */
     public Integer getAccountID() {
         return accountID;
     }
 
-    /**
-     * Sets the accountID
-     *
-     * @param accountID The accountID to set
-     */
     public void setAccountID(Integer accountID) {
         this.accountID = accountID;
     }
 
-    /**
-     * Gets the loginCount
-     *
-     * @return Returns a int
-     */
     public int getLoginCount() {
         return loginCount;
     }
 
-    /**
-     * Sets the loginCount
-     *
-     * @param loginCount The loginCount to set
-     */
     public void setLoginCount(int loginCount) {
         this.loginCount = loginCount;
     }
 
-    /**
-     * Gets the logoutCount
-     *
-     * @return Returns a int
-     */
     public int getLogoutCount() {
         return logoutCount;
     }
 
-    /**
-     * Sets the logoutCount
-     *
-     * @param logoutCount The logoutCount to set
-     */
     public void setLogoutCount(int logoutCount) {
         this.logoutCount = logoutCount;
     }
 
-    /**
-     * Gets the lastLogin
-     *
-     * @return Returns a Date
-     */
     public Date getLastLogin() {
         return lastLogin;
     }
 
-    /**
-     * Sets the lastLogin
-     *
-     * @param lastLogin The lastLogin to set
-     */
     public void setLastLogin(Date lastLogin) {
         this.lastLogin = lastLogin;
     }
 
-    /**
-     * Gets the creationDate
-     *
-     * @return Returns a Date
-     */
     public Date getCreationDate() {
         return creationDate;
     }
 
-    /**
-     * Sets the creationDate
-     *
-     * @param creationDate The creationDate to set
-     */
     public void setCreationDate(Date creationDate) {
         this.creationDate = creationDate;
     }
 
-    /**
-     * Gets the balance
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getBalance() {
         return balance;
     }
 
-    /**
-     * Sets the balance
-     *
-     * @param balance The balance to set
-     */
     public void setBalance(BigDecimal balance) {
         this.balance = balance;
     }
 
-    /**
-     * Gets the openBalance
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getOpenBalance() {
         return openBalance;
     }
 
-    /**
-     * Sets the openBalance
-     *
-     * @param openBalance The openBalance to set
-     */
     public void setOpenBalance(BigDecimal openBalance) {
         this.openBalance = openBalance;
     }
 
-    /**
-     * Gets the profileID
-     *
-     * @return Returns a String
-     */
     public String getProfileID() {
         return profileID;
     }
 
-    /**
-     * Sets the profileID
-     *
-     * @param profileID The profileID to set
-     */
     public void setProfileID(String profileID) {
         this.profileID = profileID;
     }
 
-    /**
-     * Gets the profileID
-     *
-     * @return Returns a String
-     */
     /* Disabled for D185273
      public String getUserID() {
          return getProfileID();
      }
      */
+
     public Collection<OrderDataBean> getOrders() {
         return orders;
     }
@@ -349,4 +280,21 @@
         setLogoutCount(getLogoutCount() + 1);
     }
 
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (this.accountID != null ? this.accountID.hashCode() : 0);
+        return hash;
+    }
+
+    @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 AccountDataBean)) {
+            return false;
+        }
+        AccountDataBean other = (AccountDataBean)object;
+        if (this.accountID != other.accountID && (this.accountID == null || !this.accountID.equals(other.accountID))) return false;
+        return true;
+    }
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/AccountProfileDataBean.java Wed Jul 25 10:44:00 2007
@@ -25,27 +25,37 @@
 @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.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")
+        @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 {
+public class AccountProfileDataBean implements java.io.Serializable {
 
     /* Accessor methods for persistent fields */
 
     @Id
-    //@GeneratedValue
-    @Column(nullable = false)
-    private String userID;                /* userID */
-    private String passwd;            /* password */
+    @Column(name = "USERID", nullable = false)
+    private String userID;              /* userID */
+    
+    @Column(name = "PASSWD")
+    private String passwd;              /* password */
+    
+    @Column(name = "FULLNAME")
     private String fullName;            /* fullName */
-    private String address;            /* address */
-    private String email;                /* email */
-    private String creditCard;            /* creditCard */
-    @OneToOne(mappedBy="profile")
+    
+    @Column(name = "ADDRESS")
+    private String address;             /* address */
+    
+    @Column(name = "EMAIL")
+    private String email;               /* email */
+    
+    @Column(name = "CREDITCARD")
+    private String creditCard;          /* creditCard */
+    
+    @OneToOne(mappedBy="profile", fetch=FetchType.LAZY)
     private AccountDataBean account;
+
 //    @Version
 //    private Integer optLock;
 
@@ -68,12 +78,12 @@
 
     public static AccountProfileDataBean getRandomInstance() {
         return new AccountProfileDataBean(
-                TradeConfig.rndUserID(),            // userID
-                TradeConfig.rndUserID(),            // passwd
-                TradeConfig.rndFullName(),            // fullname
-                TradeConfig.rndAddress(),            // address
-                TradeConfig.rndEmail(TradeConfig.rndUserID()), //email
-                TradeConfig.rndCreditCard()          // creditCard
+                TradeConfig.rndUserID(),                        // userID
+                TradeConfig.rndUserID(),                        // passwd
+                TradeConfig.rndFullName(),                      // fullname
+                TradeConfig.rndAddress(),                       // address
+                TradeConfig.rndEmail(TradeConfig.rndUserID()),  //email
+                TradeConfig.rndCreditCard()                     // creditCard
         );
     }
 
@@ -101,110 +111,50 @@
         Log.log(this.toString());
     }
 
-    /**
-     * Gets the userID
-     *
-     * @return Returns a String
-     */
     public String getUserID() {
         return userID;
     }
 
-    /**
-     * Sets the userID
-     *
-     * @param userID The userID to set
-     */
     public void setUserID(String userID) {
         this.userID = userID;
     }
 
-    /**
-     * Gets the passwd
-     *
-     * @return Returns a String
-     */
     public String getPassword() {
         return passwd;
     }
 
-    /**
-     * Sets the passwd
-     *
-     * @param password The passwd to set
-     */
     public void setPassword(String password) {
         this.passwd = password;
     }
 
-    /**
-     * Gets the fullName
-     *
-     * @return Returns a String
-     */
     public String getFullName() {
         return fullName;
     }
 
-    /**
-     * Sets the fullName
-     *
-     * @param fullName The fullName to set
-     */
     public void setFullName(String fullName) {
         this.fullName = fullName;
     }
 
-    /**
-     * Gets the address
-     *
-     * @return Returns a String
-     */
     public String getAddress() {
         return address;
     }
 
-    /**
-     * Sets the address
-     *
-     * @param address The address to set
-     */
     public void setAddress(String address) {
         this.address = address;
     }
 
-    /**
-     * Gets the email
-     *
-     * @return Returns a String
-     */
     public String getEmail() {
         return email;
     }
 
-    /**
-     * Sets the email
-     *
-     * @param email The email to set
-     */
     public void setEmail(String email) {
         this.email = email;
     }
 
-    /**
-     * Gets the creditCard
-     *
-     * @return Returns a String
-     */
     public String getCreditCard() {
         return creditCard;
     }
 
-    /**
-     * Sets the creditCard
-     *
-     * @param creditCard The creditCard to set
-     */
     public void setCreditCard(String creditCard) {
         this.creditCard = creditCard;
     }
@@ -215,5 +165,23 @@
 
     public void setAccount(AccountDataBean account) {
         this.account = account;
+    }
+    
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (this.userID != null ? this.userID.hashCode() : 0);
+        return hash;
+    }
+
+    @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 AccountProfileDataBean)) {
+            return false;
+        }
+        AccountProfileDataBean other = (AccountProfileDataBean)object;
+        if (this.userID != other.userID && (this.userID == null || !this.userID.equals(other.userID))) return false;
+        return true;
     }
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/HoldingDataBean.java Wed Jul 25 10:44:00 2007
@@ -27,12 +27,14 @@
 
 @Entity(name = "holdingejb")
 @Table(name = "holdingejb")
-@NamedQueries({
-@NamedQuery(name = "holdingsByUserID",
-        query = "SELECT h FROM holdingejb h where h.account.profile.userID = :userID")
-        })
-public class HoldingDataBean
-        implements Serializable {
+@NamedQueries( {
+        @NamedQuery(name = "holdingejb.findByPurchaseprice", query = "SELECT h FROM holdingejb h WHERE h.purchasePrice = :purchaseprice"),
+        @NamedQuery(name = "holdingejb.findByHoldingid", query = "SELECT h FROM holdingejb h WHERE h.holdingID = :holdingid"),
+        @NamedQuery(name = "holdingejb.findByQuantity", query = "SELECT h FROM holdingejb h WHERE h.quantity = :quantity"),
+        @NamedQuery(name = "holdingejb.findByPurchasedate", query = "SELECT h FROM holdingejb h WHERE h.purchaseDate = :purchasedate"),
+        @NamedQuery(name = "holdingejb.holdingsByUserID", query = "SELECT h FROM holdingejb h where h.account.profile.userID = :userID")
+    })
+public class HoldingDataBean implements Serializable {
 
     /* persistent/relationship fields */
 
@@ -44,21 +46,28 @@
             pkColumnValue="holding",
             allocationSize=1000)
     @Id
-    @GeneratedValue(strategy=GenerationType.TABLE,
-            generator="holdingIdGen")
-    @Column(nullable = false)
-    private Integer holdingID;            /* holdingID */
-    private double quantity;            /* quantity */
-    private BigDecimal purchasePrice;        /* purchasePrice */
+    @GeneratedValue(strategy=GenerationType.TABLE, generator="holdingIdGen")
+    @Column(name = "HOLDINGID", nullable = false)
+    private Integer holdingID;              /* holdingID */
+    
+    @Column(name = "QUANTITY", nullable = false)
+    private double quantity;                /* quantity */
+    
+    @Column(name = "PURCHASEPRICE")
+    private BigDecimal purchasePrice;       /* purchasePrice */
+    
+    @Column(name = "PURCHASEDATE")
     @Temporal(TemporalType.TIMESTAMP)
-    private Date purchaseDate;        /* purchaseDate */
+    private Date purchaseDate;              /* purchaseDate */
+    
     @Transient
-    private String quoteID;            /* Holding(*)  ---> Quote(1) */
+    private String quoteID;                 /* Holding(*)  ---> Quote(1) */
     
-    @ManyToOne
+    @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="ACCOUNT_ACCOUNTID")
     private AccountDataBean account;
-    @ManyToOne
+    
+    @ManyToOne(fetch=FetchType.EAGER)
     @JoinColumn(name = "QUOTE_SYMBOL")
     private QuoteDataBean quote;
 
@@ -124,83 +133,38 @@
         Log.log(this.toString());
     }
 
-    /**
-     * Gets the holdingID
-     *
-     * @return Returns a Integer
-     */
     public Integer getHoldingID() {
         return holdingID;
     }
 
-    /**
-     * Sets the holdingID
-     *
-     * @param holdingID The holdingID to set
-     */
     public void setHoldingID(Integer holdingID) {
         this.holdingID = holdingID;
     }
 
-    /**
-     * Gets the quantity
-     *
-     * @return Returns a BigDecimal
-     */
     public double getQuantity() {
         return quantity;
     }
 
-    /**
-     * Sets the quantity
-     *
-     * @param quantity The quantity to set
-     */
     public void setQuantity(double quantity) {
         this.quantity = quantity;
     }
 
-    /**
-     * Gets the purchasePrice
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getPurchasePrice() {
         return purchasePrice;
     }
 
-    /**
-     * Sets the purchasePrice
-     *
-     * @param purchasePrice The purchasePrice to set
-     */
     public void setPurchasePrice(BigDecimal purchasePrice) {
         this.purchasePrice = purchasePrice;
     }
 
-    /**
-     * Gets the purchaseDate
-     *
-     * @return Returns a Date
-     */
     public Date getPurchaseDate() {
         return purchaseDate;
     }
 
-    /**
-     * Sets the purchaseDate
-     *
-     * @param purchaseDate The purchaseDate to set
-     */
     public void setPurchaseDate(Date purchaseDate) {
         this.purchaseDate = purchaseDate;
     }
 
-    /**
-     * Gets the quoteID
-     *
-     * @return Returns symbol for associated quote
-     */
     public String getQuoteID() {
         if (quote != null) {
             return quote.getSymbol();
@@ -208,11 +172,6 @@
         return quoteID;
     }
 
-    /**
-     * Sets the quoteID
-     *
-     * @param quoteID The quoteID to set
-     */
     public void setQuoteID(String quoteID) {
         this.quoteID = quoteID;
     }
@@ -225,21 +184,35 @@
         this.account = account;
     }
 
-    /**
-     * Gets the quoteID
-     *
-     * @return Returns a Integer
-     */
     /* Disabled for D185273
      public String getSymbol() {
          return getQuoteID();
      }
      */
+    
     public QuoteDataBean getQuote() {
         return quote;
     }
 
     public void setQuote(QuoteDataBean quote) {
         this.quote = quote;
+    }
+    
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (this.holdingID != null ? this.holdingID.hashCode() : 0);
+        return hash;
+    }
+
+    @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 HoldingDataBean)) {
+            return false;
+        }
+        HoldingDataBean other = (HoldingDataBean) object;
+        if (this.holdingID != other.holdingID && (this.holdingID == null || !this.holdingID.equals(other.holdingID))) return false;
+        return true;
     }
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/OrderDataBean.java Wed Jul 25 10:44:00 2007
@@ -28,16 +28,21 @@
 
 @Entity(name="orderejb")
 @Table(name = "orderejb")
-@NamedQueries({
-         @NamedQuery(name="closedOrders",
-         query="SELECT o FROM orderejb o WHERE " +
-        "                    o.orderStatus = 'closed' AND " +
-        "                    o.account.profile.userID  = :userID"),
-         @NamedQuery(name="completeClosedOrders",
-         query="UPDATE orderejb o SET o.orderStatus = 'completed' WHERE " +
-        "                    o.orderStatus = 'closed' AND " +
-        "                    o.account.profile.userID  = :userID")
-        })
+@NamedQueries( {
+    @NamedQuery(name = "orderejb.findByOrderfee", query = "SELECT o FROM orderejb o WHERE o.orderFee = :orderfee"),
+    @NamedQuery(name = "orderejb.findByCompletiondate", query = "SELECT o FROM orderejb o WHERE o.completionDate = :completiondate"),
+    @NamedQuery(name = "orderejb.findByOrdertype", query = "SELECT o FROM orderejb o WHERE o.orderType = :ordertype"),
+    @NamedQuery(name = "orderejb.findByOrderstatus", query = "SELECT o FROM orderejb o WHERE o.orderStatus = :orderstatus"),
+    @NamedQuery(name = "orderejb.findByPrice", query = "SELECT o FROM orderejb o WHERE o.price = :price"),
+    @NamedQuery(name = "orderejb.findByQuantity", query = "SELECT o FROM orderejb o WHERE o.quantity = :quantity"),
+    @NamedQuery(name = "orderejb.findByOpendate", query = "SELECT o FROM orderejb o WHERE o.openDate = :opendate"),
+    @NamedQuery(name = "orderejb.findByOrderid", query = "SELECT o FROM orderejb o WHERE o.orderID = :orderid"),
+    @NamedQuery(name = "orderejb.findByAccountAccountid", query = "SELECT o FROM orderejb o WHERE o.account.accountID = :accountAccountid"),
+    @NamedQuery(name = "orderejb.findByQuoteSymbol", query = "SELECT o FROM orderejb o WHERE o.quote.symbol = :quoteSymbol"),
+    @NamedQuery(name = "orderejb.findByHoldingHoldingid", query = "SELECT o FROM orderejb o WHERE o.holding.holdingID = :holdingHoldingid"),
+    @NamedQuery(name = "orderejb.closedOrders", query = "SELECT o FROM orderejb o WHERE o.orderStatus = 'closed' AND o.account.profile.userID  = :userID"),
+    @NamedQuery(name = "orderejb.completeClosedOrders", query = "UPDATE orderejb o SET o.orderStatus = 'completed' WHERE o.orderStatus = 'closed' AND o.account.profile.userID  = :userID")
+})
 public class OrderDataBean implements Serializable
 {
 
@@ -48,41 +53,56 @@
             valueColumnName="KEYVAL",
             pkColumnValue="order",
             allocationSize=1000)
-   @Id
-   @GeneratedValue(strategy=GenerationType.TABLE,
-            generator="orderIdGen")
-    @Column(nullable = false)        
-    private Integer		orderID;			/* orderID */
-    private String		orderType;			/* orderType (buy, sell, etc.) */
-    private String		orderStatus;		/* orderStatus (open, processing, completed, closed, cancelled) */
+    @Id
+    @GeneratedValue(strategy=GenerationType.TABLE, generator="orderIdGen")
+    @Column(name = "ORDERID", nullable = false)        
+    private Integer orderID;            /* orderID */
+    
+    @Column(name = "ORDERTYPE")
+    private String orderType;           /* orderType (buy, sell, etc.) */
+    
+    @Column(name = "ORDERSTATUS")
+    private String orderStatus;         /* orderStatus (open, processing, completed, closed, cancelled) */
+    
+    @Column(name = "OPENDATE")
     @Temporal(TemporalType.TIMESTAMP)
-    private Date		openDate;			/* openDate (when the order was entered) */
+    private Date openDate;              /* openDate (when the order was entered) */
+    
+    @Column(name = "COMPLETIONDATE")
     @Temporal(TemporalType.TIMESTAMP)
-    private Date		completionDate;		/* completionDate */
-    private double	quantity;			/* quantity */
-    private BigDecimal	price;				/* price */
-    private BigDecimal	orderFee;			/* price */
-    @ManyToOne
+    private Date completionDate;		/* completionDate */
+    
+    @Column(name = "QUANTITY", nullable = false)
+    private double quantity;			/* quantity */
+    
+    @Column(name = "PRICE")
+    private BigDecimal price;				/* price */
+    
+    @Column(name = "ORDERFEE")
+    private BigDecimal orderFee;			/* price */
+    
+    @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="ACCOUNT_ACCOUNTID")
     private AccountDataBean account;
-    @ManyToOne
+    
+    @ManyToOne(fetch=FetchType.EAGER)
     @JoinColumn(name="QUOTE_SYMBOL")
     private QuoteDataBean quote;
-    @OneToOne
+    
+    @OneToOne(fetch=FetchType.LAZY)
     @JoinColumn(name = "HOLDING_HOLDINGID")
     private HoldingDataBean holding;
+
 //    @Version
 //    private Integer optLock;
 
-
     /* Fields for relationship fields are not kept in the Data Bean */
     @Transient
-    private String 		symbol;
+    private String symbol;
+
+    public OrderDataBean() {        
+    }
 
-    public OrderDataBean() {}
-    /**
-     * OrderDataBean
-     */
     public OrderDataBean(Integer orderID,
                             String orderType,
                             String orderStatus,
@@ -92,8 +112,7 @@
                             BigDecimal price,
                             BigDecimal orderFee,
                             String symbol
-                            )
-    {
+                            ) {
         setOrderID(orderID);
         setOrderType(orderType);
         setOrderStatus(orderStatus);
@@ -104,6 +123,7 @@
         setOrderFee(orderFee);
         setSymbol(symbol);
     }
+    
     public OrderDataBean(String orderType,
             String orderStatus,
             Date openDate,
@@ -112,8 +132,7 @@
             BigDecimal price,
             BigDecimal orderFee,
             AccountDataBean account,
-            QuoteDataBean quote, HoldingDataBean holding)
-    {
+            QuoteDataBean quote, HoldingDataBean holding) {
         setOrderType(orderType);
         setOrderStatus(orderStatus);
         setOpenDate(openDate);
@@ -172,147 +191,78 @@
         Log.log( this.toString() );
     }
 
-    /**
-     * Gets the orderID
-     * @return Returns a Integer
-     */
     public Integer getOrderID() {
         return orderID;
     }
-    /**
-     * Sets the orderID
-     * @param orderID The orderID to set
-     */
+
     public void setOrderID(Integer orderID) {
         this.orderID = orderID;
     }
 
-
-    /**
-     * Gets the orderType
-     * @return Returns a String
-     */
     public String getOrderType() {
         return orderType;
     }
-    /**
-     * Sets the orderType
-     * @param orderType The orderType to set
-     */
+
     public void setOrderType(String orderType) {
         this.orderType = orderType;
     }
 
-
-    /**
-     * Gets the orderStatus
-     * @return Returns a String
-     */
     public String getOrderStatus() {
         return orderStatus;
     }
-    /**
-     * Sets the orderStatus
-     * @param orderStatus The orderStatus to set
-     */
+
     public void setOrderStatus(String orderStatus) {
         this.orderStatus = orderStatus;
     }
 
-
-    /**
-     * Gets the openDate
-     * @return Returns a Date
-     */
     public Date getOpenDate() {
         return openDate;
     }
-    /**
-     * Sets the openDate
-     * @param openDate The openDate to set
-     */
+
     public void setOpenDate(Date openDate) {
         this.openDate = openDate;
     }
 
-
-    /**
-     * Gets the completionDate
-     * @return Returns a Date
-     */
     public Date getCompletionDate() {
         return completionDate;
     }
-    /**
-     * Sets the completionDate
-     * @param completionDate The completionDate to set
-     */
+
     public void setCompletionDate(Date completionDate) {
         this.completionDate = completionDate;
     }
 
-
-    /**
-     * Gets the quantity
-     * @return Returns a BigDecimal
-     */
     public double getQuantity() {
         return quantity;
     }
-    /**
-     * Sets the quantity
-     * @param quantity The quantity to set
-     */
+
     public void setQuantity(double quantity) {
         this.quantity = quantity;
     }
 
 
-    /**
-     * Gets the price
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getPrice() {
         return price;
     }
-    /**
-     * Sets the price
-     * @param price The price to set
-     */
+
     public void setPrice(BigDecimal price) {
         this.price = price;
     }
 
-
-    /**
-     * Gets the orderFee
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getOrderFee() {
         return orderFee;
     }
-    /**
-     * Sets the orderFee
-     * @param orderFee The orderFee to set
-     */
+
     public void setOrderFee(BigDecimal orderFee) {
         this.orderFee = orderFee;
     }
 
-    /**
-     * Gets the symbol
-     * @return Returns a String
-     */
     public String getSymbol() {
         if (quote != null) {
             return quote.getSymbol();
         }
         return symbol;
     }
-    /**
-     * Sets the symbol
-     * @param symbol The symbol to set
-     */
+
     public void setSymbol(String symbol) {
         this.symbol = symbol;
     }
@@ -390,5 +340,22 @@
 		setOrderStatus("cancelled");
 	}
 
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (this.orderID != null ? this.orderID.hashCode() : 0);
+        return hash;
+    }
+    
+    @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 OrderDataBean)) {
+            return false;
+        }
+        OrderDataBean other = (OrderDataBean)object;
+        if (this.orderID != other.orderID && (this.orderID == null || !this.orderID.equals(other.orderID))) return false;
+        return true;
+    }
 }
 

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/QuoteDataBean.java Wed Jul 25 10:44:00 2007
@@ -27,14 +27,14 @@
 @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 = "quoteejb.allQuotes",query = "SELECT q FROM quoteejb q"),
+    @NamedQuery(name = "quoteejb.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.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")
 })
@@ -46,20 +46,38 @@
     /* Accessor methods for persistent fields */
 
     @Id
-    private String symbol;         /* symbol */
-    private String companyName; /* companyName */
-    private double volume;         /* volume */
-    private BigDecimal price;     /* price */
-    private BigDecimal open1;     /* open1 price */
-    private BigDecimal low;     /* low price */
-    private BigDecimal high;    /* high price */
-    private double change1;     /* price change */
-    @OneToMany(mappedBy = "quote")
-    private Collection<OrderDataBean> orders;
+    @Column(name = "SYMBOL", nullable = false)
+    private String symbol;          /* symbol */
+    
+    @Column(name = "COMPANYNAME")
+    private String companyName;     /* companyName */
+    
+    @Column(name = "VOLUME", nullable = false)
+    private double volume;          /* volume */
+    
+    @Column(name = "PRICE")
+    private BigDecimal price;       /* price */
+    
+    @Column(name = "OPEN1")
+    private BigDecimal open1;       /* open1 price */
+    
+    @Column(name = "LOW")
+    private BigDecimal low;         /* low price */
+    
+    @Column(name = "HIGH")
+    private BigDecimal high;        /* high price */
+    
+    @Column(name = "CHANGE1", nullable = false)
+    private double change1;         /* price change */
+    
+    /*@OneToMany(mappedBy = "quote")
+    private Collection<OrderDataBean> orders;*/
+    
 //    @Version
 //    private Integer optLock;
 
     /* Accessor methods for relationship fields are not kept in the DataBean */
+    
     public QuoteDataBean() {
     }
 
@@ -94,7 +112,6 @@
         setSymbol(symbol);
     }
 
-
     public String toString() {
         return "\n\tQuote Data for: " + getSymbol()
                 + "\n\t\t companyName: " + getCompanyName()
@@ -123,148 +140,85 @@
         Log.log(this.toString());
     }
 
-    /**
-     * Gets the symbol
-     *
-     * @return Returns a String
-     */
     public String getSymbol() {
         return symbol;
     }
 
-    /**
-     * Sets the symbol
-     *
-     * @param symbol The symbol to set
-     */
     public void setSymbol(String symbol) {
         this.symbol = symbol;
     }
 
-    /**
-     * Gets the companyName
-     *
-     * @return Returns a String
-     */
     public String getCompanyName() {
         return companyName;
     }
 
-    /**
-     * Sets the companyName
-     *
-     * @param companyName The companyName to set
-     */
     public void setCompanyName(String companyName) {
         this.companyName = companyName;
     }
 
-    /**
-     * Gets the price
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getPrice() {
         return price;
     }
 
-    /**
-     * Sets the price
-     *
-     * @param price The price to set
-     */
     public void setPrice(BigDecimal price) {
         this.price = price;
     }
 
-    /**
-     * Gets the open1
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getOpen() {
         return open1;
     }
 
-    /**
-     * Sets the open1
-     *
-     * @param open The open1 to set
-     */
     public void setOpen(BigDecimal open) {
         this.open1 = open;
     }
 
-    /**
-     * Gets the low
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getLow() {
         return low;
     }
 
-    /**
-     * Sets the low
-     *
-     * @param low The low to set
-     */
     public void setLow(BigDecimal low) {
         this.low = low;
     }
 
-    /**
-     * Gets the high
-     *
-     * @return Returns a BigDecimal
-     */
     public BigDecimal getHigh() {
         return high;
     }
 
-    /**
-     * Sets the high
-     *
-     * @param high The high to set
-     */
     public void setHigh(BigDecimal high) {
         this.high = high;
     }
 
-    /**
-     * Gets the change1
-     *
-     * @return Returns a double
-     */
     public double getChange() {
         return change1;
     }
 
-    /**
-     * Sets the change1
-     *
-     * @param change The change1 to set
-     */
     public void setChange(double change) {
         this.change1 = change;
     }
 
-    /**
-     * Gets the volume
-     *
-     * @return Returns a BigDecimal
-     */
     public double getVolume() {
         return volume;
     }
 
-    /**
-     * Sets the volume
-     *
-     * @param volume The volume to set
-     */
     public void setVolume(double volume) {
         this.volume = volume;
     }
 
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (this.symbol != null ? this.symbol.hashCode() : 0);
+        return hash;
+    }
+    
+    @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 QuoteDataBean)) {
+            return false;
+        }
+        QuoteDataBean other = (QuoteDataBean)object;
+        if (this.symbol != other.symbol && (this.symbol == null || !this.symbol.equals(other.symbol))) return false;
+        return true;
+    }
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java Wed Jul 25 10:44:00 2007
@@ -24,6 +24,7 @@
 
 import org.apache.geronimo.samples.daytrader.direct.TradeDirect;
 import org.apache.geronimo.samples.daytrader.ejb.TradeHome;
+import org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote;
 import org.apache.geronimo.samples.daytrader.session.TradeJDBCHome;
 import org.apache.geronimo.samples.daytrader.util.FinancialUtils;
 import org.apache.geronimo.samples.daytrader.util.Log;
@@ -37,7 +38,10 @@
  * making calls to TradeAction methods to actually performance each operation.
  */
 public class TradeAction implements TradeServices {
-    private TradeServices trade = null;
+    // make this static so the trade impl can be cached
+    // - ejb3 mode is the only thing that really uses this
+    // - can go back and update other modes to take advantage (ie. TradeDirect)
+    private static TradeServices trade = null;
     private static TradeHome tradeHome = null;
     private static TradeJDBCHome tradeJDBCHome = null;
     private static TradeHome tradeHomeJPA = null;
@@ -74,7 +78,7 @@
                 Log.error("TradeAction:TradeAction() Creation of Trade EJB failed\n" + e);
                 e.printStackTrace();
             }
-        } else        if (TradeConfig.runTimeMode == TradeConfig.JPA) {
+        } else if (TradeConfig.runTimeMode == TradeConfig.JPA) {
             try {
                 if (tradeHomeJPA == null) {
                     InitialContext ic = new InitialContext();
@@ -92,7 +96,26 @@
                 Log.error("TradeAction:TradeAction() Creation of Trade JPA failed\n" + e);
                 e.printStackTrace();
             }
-        } else if (TradeConfig.runTimeMode == TradeConfig.DIRECT) {
+        } else if (TradeConfig.runTimeMode == TradeConfig.EJB3) {
+            try {
+                if (!(trade instanceof TradeSLSBRemote)) {
+                    TradeSLSBRemote tradeSLSB = null;
+                    InitialContext context = new InitialContext();
+                    try {
+                        tradeSLSB = (TradeSLSBRemote) context.lookup("java:comp/env/ejb/TradeSLSBBean");                
+                    } catch (Exception ex) {
+                        Log.error("TradeAction:createTrade - Lookup of TradeSLSBRemote failed!!!");
+                        tradeSLSB = (TradeSLSBRemote) context.lookup("TradeSLSBBean");
+                    }
+                
+                    trade = tradeSLSB;
+                }
+            }
+            catch (Exception e) {
+                Log.error("TradeAction:TradeAction() Creation of Trade JPA failed\n" + e);
+                e.printStackTrace();
+            }
+        }else if (TradeConfig.runTimeMode == TradeConfig.DIRECT) {
             try {
                 trade = new TradeDirect();
             }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeConfig.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeConfig.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeConfig.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeConfig.java Wed Jul 25 10:44:00 2007
@@ -34,11 +34,12 @@
 	/* Trade Runtime Configuration Parameters */
 
 	/* Trade Runtime Mode parameters */
-	public static String[] runTimeModeNames = { "EJB", "Direct", "SessionDirect", "JPA" };
+	public static String[] runTimeModeNames = { "EJB", "Direct", "SessionDirect", "JPA", "EJB3" };
 	public static final int EJB = 0;
 	public static final int DIRECT = 1;
 	public static final int SESSION = 2;
 	public static final int JPA = 3;
+    public static final int EJB3 = 4;
 	public static int runTimeMode = JPA;
 
 	public static String[] orderProcessingModeNames =

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeJPA.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeJPA.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeJPA.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeJPA.java Wed Jul 25 10:44:00 2007
@@ -119,7 +119,7 @@
             //ordered by their change in value
             Collection quotes;
 //            if (orderBySQLSupported) {
-                Query query = entityManager.createNamedQuery("quotesByChange");
+                Query query = entityManager.createNamedQuery("quoteejb.quotesByChange");
                 quotes = query.getResultList();
 //            }
 //            else
@@ -212,7 +212,7 @@
             throws Exception {
         if (Log.doTrace()) Log.trace("TradeBean:getAllQuotes");
 
-            Query query = entityManager.createNamedQuery("allQuotes");
+            Query query = entityManager.createNamedQuery("quoteejb.allQuotes");
             return query.getResultList();
     }
 
@@ -467,10 +467,10 @@
             */
 
             //Get the primary keys for all the closed Orders for this account.
-            Query query = entityManager.createNamedQuery("closedOrders");
+            Query query = entityManager.createNamedQuery("orderejb.closedOrders");
             query.setParameter("userID", userID);
             Collection results = query.getResultList();
-            Query updateStatus = entityManager.createNamedQuery("completeClosedOrders");
+            Query updateStatus = entityManager.createNamedQuery("orderejb.completeClosedOrders");
             updateStatus.setParameter("userID", userID);
             updateStatus.executeUpdate();
             return results;
@@ -616,7 +616,7 @@
             throws FinderException, Exception {
         if (Log.doTrace())
             Log.trace("TradeBean:getHoldings", userID);
-        Query query = entityManager.createNamedQuery("holdingsByUserID");
+        Query query = entityManager.createNamedQuery("holdingejb.holdingsByUserID");
         query.setParameter("userID", userID);
         return query.getResultList();
     }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java Wed Jul 25 10:44:00 2007
@@ -43,12 +43,10 @@
 	
 	private ConnectionFactory qConnFactory = null;
 	
-	@Resource(name = "jms/TradeBrokerQueue") 
 	private Queue brokerQueue = null;
 	
 	private ConnectionFactory tConnFactory = null;
 	
-	@Resource(name = "jms/TradeStreamerTopic") 
 	private Topic streamerTopic = null; 
 
 	//Boolean to signify if the Order By clause is supported by the app server.

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestBean.java Wed Jul 25 10:44:00 2007
@@ -20,18 +20,20 @@
     @Resource(name = "jms/QueueConnectionFactory")
     private ConnectionFactory queueConnectionFactory;
     
-    @Resource(name = "jms/TradeBrokerQueue")
+    @Resource(name = "TestQueue")
     private Queue tradeBrokerQueue;
 
     /** Creates a new instance of LocalSLMDBTestBean */
     public LocalSLMDBTestBean() {
     }
     
-    public Message publishToTradeBrokerQueue() {
-        Message message = null;
+    public String publishToTradeBrokerQueue() {
+        String message = null;
         
         try {
-            message = this.sendJMSMessageToTestMDB("Hello World from TradeBrokerQueue!");
+            Message tmp = this.sendJMSMessageToTestMDB("Hello World from TradeBrokerQueue!");
+            if (tmp != null)
+                message = tmp.toString();
         } catch (Exception ex) {
             ex.printStackTrace();
         }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestLocal.java Wed Jul 25 10:44:00 2007
@@ -10,5 +10,5 @@
  */
 @Local
 public interface LocalSLMDBTestLocal {
-    public Message publishToTradeBrokerQueue();
+    public String publishToTradeBrokerQueue();
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/LocalSLMDBTestRemote.java Wed Jul 25 10:44:00 2007
@@ -10,5 +10,5 @@
  */
 @Remote
 public interface LocalSLMDBTestRemote {
-    public Message publishToTradeBrokerQueue();
+    public String publishToTradeBrokerQueue();
 }

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb3/prims/TestMDB.java Wed Jul 25 10:44:00 2007
@@ -5,11 +5,11 @@
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
-//@MessageDriven(name = "ejb/TestMDB", activationConfig =  {
-//        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
-//        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-//        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/TradeBrokerQueue")
-//    })
+@MessageDriven(activationConfig =  {
+        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
+        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+        @ActivationConfigProperty(propertyName = "destination", propertyValue = "TestQueue")
+    })
 public class TestMDB implements MessageListener {
     
     /** Creates a new instance of TradeTestMDB */

Modified: geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml (original)
+++ geronimo/daytrader/trunk/modules/ejb/src/main/resources/META-INF/ejb-jar.xml Wed Jul 25 10:44:00 2007
@@ -149,13 +149,13 @@
                 <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
                 <message-destination-type>javax.jms.Queue</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
+                <message-destination-link>TradeBrokerQueue</message-destination-link>
             </message-destination-ref>
             <message-destination-ref>
                 <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
                 <message-destination-type>javax.jms.Topic</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
+                <message-destination-link>TradeStreamerTopic</message-destination-link>
             </message-destination-ref>
             <security-identity>
                 <description/>
@@ -163,6 +163,7 @@
             </security-identity>
         </session>
 
+
         <!--
           **
           **  T r a d e J P A
@@ -208,13 +209,13 @@
                 <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
                 <message-destination-type>javax.jms.Queue</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
+                <message-destination-link>TradeBrokerQueue</message-destination-link>
             </message-destination-ref>
             <message-destination-ref>
                 <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
                 <message-destination-type>javax.jms.Topic</message-destination-type>
                 <message-destination-usage>Produces</message-destination-usage>
-                <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
+                <message-destination-link>TradeStreamerTopic</message-destination-link>
             </message-destination-ref>
             <security-identity>
                 <description/>
@@ -778,9 +779,10 @@
             <display-name>TradeBrokerMDB</display-name>
             <ejb-name>TradeBrokerMDB</ejb-name>
             <ejb-class>org.apache.geronimo.samples.daytrader.ejb.TradeBrokerMDB</ejb-class>
-            <transaction-type>Container</transaction-type>
+            <messaging-type>javax.jms.MessageListener</messaging-type>
+			<transaction-type>Container</transaction-type>
             <message-destination-type>javax.jms.Queue</message-destination-type>
-            <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
+            <message-destination-link>TradeBrokerQueue</message-destination-link>
             <env-entry>
                 <env-entry-name>statInterval</env-entry-name>
                 <env-entry-type>java.lang.Integer</env-entry-type>
@@ -803,9 +805,10 @@
         <message-driven>
             <ejb-name>TradeStreamerMDB</ejb-name>
             <ejb-class>org.apache.geronimo.samples.daytrader.ejb.TradeStreamerMDB</ejb-class>
+            <messaging-type>javax.jms.MessageListener</messaging-type>
             <transaction-type>Container</transaction-type>
             <message-destination-type>javax.jms.Topic</message-destination-type>
-            <message-destination-link>jms/TradeStreamerTopic</message-destination-link>
+            <message-destination-link>TradeStreamerTopic</message-destination-link>
             <env-entry>
                 <env-entry-name>statInterval</env-entry-name>
                 <env-entry-type>java.lang.Integer</env-entry-type>
@@ -1290,11 +1293,11 @@
          **
          -->
         <message-destination>
-            <message-destination-name>jms/TradeBrokerQueue</message-destination-name>
+            <message-destination-name>TradeBrokerQueue</message-destination-name>
         </message-destination>
 
         <message-destination>
-            <message-destination-name>jms/TradeStreamerTopic</message-destination-name>
+            <message-destination-name>TradeStreamerTopic</message-destination-name>
         </message-destination>
 
     </assembly-descriptor>

Modified: geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/webapp/WEB-INF/web.xml Wed Jul 25 10:44:00 2007
@@ -828,6 +828,12 @@
 		<remote>org.apache.geronimo.samples.daytrader.ejb.Trade</remote>
 		<ejb-link>TradeJPA</ejb-link>
 	</ejb-ref>
+    <ejb-ref>
+        <ejb-ref-name>ejb/TradeSLSBBean</ejb-ref-name>
+        <ejb-ref-type>Session</ejb-ref-type>
+        <remote>org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote</remote>
+        <ejb-link>TradeSLSBBean</ejb-link>
+    </ejb-ref>
 	<ejb-ref>
 		<ejb-ref-name>ejb/TradeJDBC</ejb-ref-name>
 		<ejb-ref-type>Session</ejb-ref-type>
@@ -870,29 +876,17 @@
 	</ejb-local-ref>
 	<message-destination-ref>
 	    <!--  This is the JNDI name of where the resource will appear -->
-		<message-destination-ref-name>
-			jms/TradeBrokerQueue
-		</message-destination-ref-name>
-		<message-destination-type>
-			javax.jms.Queue
-		</message-destination-type>
+		<message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
+		<message-destination-type>javax.jms.Queue</message-destination-type>
 		<message-destination-usage>Produces</message-destination-usage>
 		<!--  Must match the message-destination defined later  -->
-		<message-destination-link>
-			dt-ejb.jar#jms/TradeBrokerQueue
-		</message-destination-link>
+		<message-destination-link>dt-ejb.jar#TradeBrokerQueue</message-destination-link>
 	</message-destination-ref>
 	<message-destination-ref>
-		<message-destination-ref-name>
-			jms/TradeStreamerTopic
-		</message-destination-ref-name>
-		<message-destination-type>
-			javax.jms.Topic
-		</message-destination-type>
+		<message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
+		<message-destination-type>javax.jms.Topic</message-destination-type>
 		<message-destination-usage>Produces</message-destination-usage>
-		<message-destination-link>
-			dt-ejb.jar#jms/TradeStreamerTopic
-		</message-destination-link>
+		<message-destination-link>dt-ejb.jar#TradeStreamerTopic</message-destination-link>
 	</message-destination-ref>
 	<service-ref>
 		<description>WSDL Service Trade</description>

Modified: geronimo/daytrader/trunk/plans/daytrader-g-2.0-SNAPSHOT-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/plans/daytrader-g-2.0-SNAPSHOT-plan.xml?view=diff&rev=559534&r1=559533&r2=559534
==============================================================================
--- geronimo/daytrader/trunk/plans/daytrader-g-2.0-SNAPSHOT-plan.xml (original)
+++ geronimo/daytrader/trunk/plans/daytrader-g-2.0-SNAPSHOT-plan.xml Wed Jul 25 10:44:00 2007
@@ -98,10 +98,6 @@
                 <session>
                     <ejb-name>TradeEJB</ejb-name>
                     <jndi-name>ejb/TradeEJB</jndi-name>
-                    <!-- resource-env-ref>
-                        <ref-name>jms/TradeBrokerQueue</ref-name>
-                        <message-destination-link>jms/TradeBrokerQueue</message-destination-link>
-                    </resource-env-ref -->
                 </session>
                 
                 <session>
@@ -334,11 +330,11 @@
                     <activation-config>
                         <activation-config-property>
                             <activation-config-property-name>destinationType</activation-config-property-name>
-                            <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
+                            <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
                         </activation-config-property>
                         <activation-config-property>
                             <activation-config-property-name>destination</activation-config-property-name>
-                            <activation-config-property-value>jms/TradeStreamerTopic</activation-config-property-value>
+                            <activation-config-property-value>TradeStreamerTopic</activation-config-property-value>
                         </activation-config-property>
                         <activation-config-property>
                             <activation-config-property-name>acknowledgeMode</activation-config-property-name>
@@ -364,7 +360,7 @@
                         </activation-config-property>
                         <activation-config-property>
                             <activation-config-property-name>destination</activation-config-property-name>
-                            <activation-config-property-value>jms/TradeBrokerQueue</activation-config-property-value>
+                            <activation-config-property-value>TradeBrokerQueue</activation-config-property-value>
                         </activation-config-property>
                         <activation-config-property>
                             <activation-config-property-name>acknowledgeMode</activation-config-property-name>
@@ -376,6 +372,27 @@
                         </activation-config-property>
                     </activation-config>
                 </message-driven>
+                
+                <message-driven>
+                    <ejb-name>TestMDB</ejb-name>
+                    <resource-adapter>
+                        <resource-link>TradeJMSResources</resource-link>
+                    </resource-adapter>
+                </message-driven>
+                
+                <message-driven>
+                    <ejb-name>DTBroker3MDB</ejb-name>
+                    <resource-adapter>
+                        <resource-link>TradeJMSResources</resource-link>
+                    </resource-adapter>
+                </message-driven>
+                
+                <message-driven>
+                    <ejb-name>DTStreamer3MDB</ejb-name>
+                    <resource-adapter>
+                        <resource-link>TradeJMSResources</resource-link>
+                    </resource-adapter>
+                </message-driven>
             </enterprise-beans>
 
             <!--
@@ -771,7 +788,7 @@
                 <adminobject-interface>javax.jms.Topic</adminobject-interface>
                 <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
                 <adminobject-instance>
-                    <message-destination-name>jms/TradeStreamerTopic</message-destination-name>
+                    <message-destination-name>TradeStreamerTopic</message-destination-name>
                     <config-property-setting name="PhysicalName">TradeStreamerTopic</config-property-setting>
                 </adminobject-instance>
             </adminobject>
@@ -780,8 +797,35 @@
                 <adminobject-interface>javax.jms.Queue</adminobject-interface>
                 <adminobject-class>org.activemq.message.ActiveMQQueue</adminobject-class>
                 <adminobject-instance>
-                    <message-destination-name>jms/TradeBrokerQueue</message-destination-name>
+                    <message-destination-name>TradeBrokerQueue</message-destination-name>
                     <config-property-setting name="PhysicalName">TradeBrokerQueue</config-property-setting>
+                </adminobject-instance>
+            </adminobject>
+            
+            <adminobject>
+                <adminobject-interface>javax.jms.Topic</adminobject-interface>
+                <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+                <adminobject-instance>
+                    <message-destination-name>DTStreamerTopic3</message-destination-name>
+                    <config-property-setting name="PhysicalName">DTStreamerTopic3</config-property-setting>
+                </adminobject-instance>
+            </adminobject>
+            
+            <adminobject>
+                <adminobject-interface>javax.jms.Queue</adminobject-interface>
+                <adminobject-class>org.activemq.message.ActiveMQQueue</adminobject-class>
+                <adminobject-instance>
+                    <message-destination-name>DTBrokerQueue3</message-destination-name>
+                    <config-property-setting name="PhysicalName">DTBrokerQueue3</config-property-setting>
+                </adminobject-instance>
+            </adminobject>
+            
+            <adminobject>
+                <adminobject-interface>javax.jms.Queue</adminobject-interface>
+                <adminobject-class>org.activemq.message.ActiveMQQueue</adminobject-class>
+                <adminobject-instance>
+                    <message-destination-name>TestQueue</message-destination-name>
+                    <config-property-setting name="PhysicalName">TestQueue</config-property-setting>
                 </adminobject-instance>
             </adminobject>
 



Mime
View raw message