Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032261Openbravo ERPA. Platformpublic2016-02-17 15:252016-03-17 10:56
alostale 
alostale 
normaltrivialN/A
closedfixed 
5
 
3.0PR16Q2 
caristu
Core
No
0032261: implement a typed version of OBDal.getProxy
Existing OBDal.getProxy method allows to obtain a proxy to a BaseOBObject, based on an entity name.

Usually, this proxy is going to be used as an instance of that entity class. So in this common case it needs to be cast, it would be useful to have a typed version of this method so that returns a typed instance making not necessary to do the casting being also less error prone.

Assuming bp is a BusinessPartner, currently to get a proxy for it, it is needed to do:

BusinessPartner bp = (BusinessPartner) OBDal.getInstance().getProxy(BusinessPartner.ENTITY_NAME, bpId);

Ideally the code above should be equivalent to:
BusinessPartner bp = OBDal.getInstance().getProxy(BusinessPartner.class, bpId);
No tags attached.
blocks feature request 00325113.0PR16Q3 closed alostale support JBoss AS 7.1.1 
Issue History
2016-02-17 15:25alostaleNew Issue
2016-02-17 15:25alostaleAssigned To => alostale
2016-02-17 15:25alostaleModules => Core
2016-02-17 15:25alostaleTriggers an Emergency Pack => No
2016-02-17 15:26alostaleProposed Solution updated
2016-02-17 15:30hgbotCheckin
2016-02-17 15:30hgbotNote Added: 0084289
2016-02-17 15:30hgbotStatusnew => resolved
2016-02-17 15:30hgbotResolutionopen => fixed
2016-02-17 15:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/64b3eaea9b866f58cc4e480a6850ad787e1242ed [^]
2016-02-17 15:30alostaleReview Assigned To => caristu
2016-02-19 08:17caristuNote Added: 0084341
2016-02-19 08:17caristuStatusresolved => closed
2016-02-19 08:17caristuFixed in Version => 3.0PR16Q2
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085147
2017-11-02 09:57alostaleRelationship addedblocks 0032511

Notes
(0084289)
hgbot   
2016-02-17 15:30   
Repository: erp/devel/pi
Changeset: 64b3eaea9b866f58cc4e480a6850ad787e1242ed
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Feb 17 15:29:19 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/64b3eaea9b866f58cc4e480a6850ad787e1242ed [^]

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.

---
M src/org/openbravo/dal/service/OBDal.java
---
(0084341)
caristu   
2016-02-19 08:17   
Verified
(0085147)
hudsonbot   
2016-03-17 10:56   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b22fb0500156 [^]
Maturity status: Test