details:   https://code.openbravo.com/erp/devel/pi/rev/64b3eaea9b86
changeset: 28614:64b3eaea9b86
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Wed Feb 17 15:29:19 2016 +0100
summary:   fixed issue 32261: implement a typed version of OBDal.getProxy

  New getProxy method returns a typed instance of the desired entity, making
  unnecessary to cast it.

diffstat:

 src/org/openbravo/dal/service/OBDal.java |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 983bdd5eab9b -r 64b3eaea9b86 src/org/openbravo/dal/service/OBDal.java
--- a/src/org/openbravo/dal/service/OBDal.java  Wed Feb 17 13:14:36 2016 +0100
+++ b/src/org/openbravo/dal/service/OBDal.java  Wed Feb 17 15:29:19 2016 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -346,6 +346,15 @@
   }
 
   /**
+   * Typed version of {@link OBDal#getProxy(String, Object)} returning a 
proxied instance of
+   * {@code entityClass}
+   */
+  @SuppressWarnings("unchecked")
+  public <T extends BaseOBObject> T getProxy(Class<T> entityClass, String id) {
+    return (T) getProxy(DalUtil.getEntityName(entityClass), id);
+  }
+
+  /**
    * Create a OBQuery object using a class and a specific where and order by 
clause.
    * 
    * @param fromClz

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to