Commit Graph
887 Commits
Author SHA1 Message Date
Adrian Crum 25c04f28af Partially reverting rev 1372738. As Scott pointed out on the dev mailing list, the conditions requiring a cast are rare - rendering those optimizations ineffective.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1373239 13f79535-47bb-0310-9956-ffa450edef68
2012-08-15 07:08:57 +00:00
Adrian Crum afd4e8b3c0 Small GenericEntity optimization - remove instanceof checks in getXxx methods.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1372738 13f79535-47bb-0310-9956-ffa450edef68
2012-08-14 06:02:58 +00:00
Erwan de Ferrieres 342c56d85c correcting javadoc for DynamicViewEntity.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369406 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 18:47:26 +00:00
Erwan de Ferrieres ebad9a93df missing ending } in javadoc
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1367750 13f79535-47bb-0310-9956-ffa450edef68
2012-07-31 20:24:42 +00:00
David E. Jones 3ec005ae79 Changed so that cus-obj element value is not in a CDATA block; it is already hex encoded so does not need to be in a CDATA block, and in entity exports of the RuntimeData entity it ends up being causing a nested CDATA block, which is not allowed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364822 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 22:10:29 +00:00
Jacopo Cappellato 519465c113 Made constructor private according to the design of this class (instances are created using the static getModelReader that also takes care of managing the cache).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364045 13f79535-47bb-0310-9956-ffa450edef68
2012-07-21 08:39:11 +00:00
Adrian Crum 3df18870cc Some trivial changes in the entity config classes - mostly JavaDocs, remove unnecessary calls to UtilValidate. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362790 13f79535-47bb-0310-9956-ffa450edef68
2012-07-18 07:15:45 +00:00
Adrian Crum ca716388f8 Added a new attribute to the entity definition - "redefinition" - which will suppress "Entity is defined more than once" warnings.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362772 13f79535-47bb-0310-9956-ffa450edef68
2012-07-18 05:42:24 +00:00
Jacopo Cappellato 6137a3bf47 Minor change to set a consistent naming format for all the threads started by OFBiz.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362417 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 09:05:33 +00:00
Jacques Le Roux feecb15093 "Housekeeping of jar files" https://issues.apache.org/jira/browse/OFBIZ-4833
Moves Minerva and XAPool to Attic

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1356471 13f79535-47bb-0310-9956-ffa450edef68
2012-07-02 20:29:54 +00:00
Adrian Crum dfb74cc196 Fixed some bugs in EntityFinderUtil.java:
1. LimitRange and LimitView classes treated ELI and List indexes the same - causing inconsistent results because ELI indexes are one-based and List indexes are zero-based.
2. LimitRange and LimitView classes returned different results at the end of the list depending on whether an ELI or List was being used.
3. LimitView class view index calculation was wrong.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1356201 13f79535-47bb-0310-9956-ffa450edef68
2012-07-02 12:16:36 +00:00
Adrian Crum 83c60b16da Small fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1356168 13f79535-47bb-0310-9956-ffa450edef68
2012-07-02 10:33:49 +00:00
Adrian Crum 523436cb76 Some optimizations in EntityFinderUtil.java:
1. Made the Condition implementations immutable and thread-safe.
2. Moved operator lookup from run-time to parse-time.
3. Removed unnecessary calls to UtilValidate.
4. Replaced LinkedList with ArrayList.
5. Optimized code in the ConditionExpr.createCondition method.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1356024 13f79535-47bb-0310-9956-ffa450edef68
2012-07-01 20:54:23 +00:00
Jacopo Cappellato 15fe323128 Removed some junk and unused code left over after the commit:
Author: jleroux
Date: Fri Jun  3 19:05:07 2011
New Revision: 1131144

was "reverted" as part of:
 
 Author: jleroux
 Date: Fri Sep 23 19:22:40 2011
 New Revision: 1174964
 
 The code is still broken.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353094 13f79535-47bb-0310-9956-ffa450edef68
2012-06-23 08:33:01 +00:00
Hans Bakker 5ea30aab8f tenant data in the entity component is meant for demo, so demo data. comment from Adam
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351213 13f79535-47bb-0310-9956-ffa450edef68
2012-06-18 06:40:31 +00:00
Hans Bakker 14f4e5a292 reverted recent security file changes revisions: 1350847,1350843,1350840,1348534,1347908,1347213,1346264, need more investigation
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351206 13f79535-47bb-0310-9956-ffa450edef68
2012-06-18 04:36:20 +00:00
Hans Bakker a8040d7806 security should be loaded first
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1347213 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 00:04:08 +00:00
Hans Bakker f6a992b6ee tenant data in the entity component is meant for demo, so demo data. comment from Adam
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1346713 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 02:20:54 +00:00
Hans Bakker d2ae6af774 enable tenant demo data
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1346269 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 07:35:26 +00:00
Hans Bakker fff7f99081 introduced a new data-reader : 'security'
Security is now by default not loaded because not part of seed anymore this will make all component hidden and not accessible .
It is still loaded as part of the reader 'demo'

to load the security files:
./ant load-readers -Ddata-readers=security

Now it is possible to load only a selection of the security files in your hot-deploy component as follows:

<entity-resource type=data reader-name=seed loader=main location=../../framework/security/data/SecurityData.xml/>
<entity-resource type=data reader-name=seed loader=main location=../../framework/webtools/data/WebtoolsSecurityData.xml/>
<entity-resource type=data reader-name=seed loader=main location=../../applications/party/data/PartySecurityData.xml/>

This will enable only standard groups, the party and the webtools application.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1346255 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 06:37:06 +00:00
Jacopo Cappellato df927cd6dd Fixed lock that was set to the wrong class (this was probably caused by a copy and paste error).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1345001 13f79535-47bb-0310-9956-ffa450edef68
2012-06-01 07:13:59 +00:00
Jacopo Cappellato f6fc46c679 Removed default value for the attribute for inline-jdbc used to specify an XA wrapper class: it was set to a specific implementation (Enhydra).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1344999 13f79535-47bb-0310-9956-ffa450edef68
2012-06-01 07:10:39 +00:00
Jacopo Cappellato c4c79f58e8 Improved code that manages the cache:
* removed unnecessary synchronization
* protected the UtilCache object (static field) by making it private and final



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 10:54:16 +00:00
Adam Heath d9a34a8c8c Deprecate EntityUtil.getRelated(ByAnd|OrderBy)(|Cache), replaced with
the single getRelated variant.

EntityUtil.getRelatedByAnd(String, Map) replaced by
EntityUtil.getRelated(String, Map, List, boolean)

EntityUtil.getRelatedByAndCache(String, Map) replaced by
EntityUtil.getRelated(String, Map, List, boolean)

EntityUtil.getRelatedOrderBy(String, List) replaced by
EntityUtil.getRelated(String, Map, List, boolean)

EntityUtil.getRelatedOrderByCache(String, List) replaced by
EntityUtil.getRelated(String, Map, List, boolean)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343532 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:21:38 +00:00
Adam Heath 4a0f383a5a Deprecate GenericValue.getRelated(ByAnd|OrderBy)(|Cache), replaced with
the single getRelated variant.

GenericValue.getRelatedByAnd(String, Map) replaced by
GenericValue.getRelated(String, Map, List, boolean)

GenericValue.getRelatedByAndCache(String, Map) replaced by
GenericValue.getRelated(String, Map, List, boolean)

GenericValue.getRelatedOrderBy(String, List) replaced by
GenericValue.getRelated(String, Map, List, boolean)

GenericValue.getRelatedOrderByCache(String, List) replaced by
GenericValue.getRelated(String, Map, List, boolean)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343531 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:21:21 +00:00
Adam Heath e3c2dac101 DEPRECATION: framework: GenericValue.getRelated(ByAnd|OrderBy)(|Cache)
replaced by the single getRelated variant.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343527 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:20:26 +00:00
Adam Heath fb698e509b Deprecate all GenericValue.getRelated and GenericValue.getRelatedCache,
and add a version that takes a cache parameter.

Continuing the simplication of the entity api, this is the final step to
replacing all the GenericValue.getRelated(and cache versions as well)
with a variant that takes a boolean useCache parameter.

GenericValue.getRelated(String) is replaced by
GenericValue.getRelated(String, Map, List, boolean).

GenericValue.getRelated(String, List) is replaced by
GenericValue.getRelated(String, Map, List, boolean).

GenericValue.getRelated(String, Map, List) is replaced by
GenericValue.getRelated(String, Map, List, boolean).

GenericValue.getRelatedCache(String) is replaced by
GenericValue.getRelated(String, Map, List, boolean).

GenericValue.getRelatedCache(String, Map, List) is replaced by
GenericValue.getRelated(String, Map, List, boolean).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343526 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:20:19 +00:00
Adam Heath 83d37a796b DEPRECATION: framework: GenericValue.getRelated/getRelatedCache variants replaced with a single getRelated variant that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343509 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:17:17 +00:00
Adam Heath 21c0cef59e DEPRECATION: Add a new GenericValue.getRelated() variant that takes a
boolean useCache parameter.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343508 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:16:57 +00:00
Adam Heath fb3e3bb557 Deprecate all Delegator.getRelated and Delegator.getRelatedCache
and add a version that takes a cache parameter.

This Continuing the simplication of the entity api, this is the final step to
replacing all the GenericValue.getRelated(and cache versions as well)
with a variant that takes a boolean useCache parameter.

Delegator.getRelated(String, Map, List, GenericValue) is replaced by
Delegator.getRelated(String, Map, List, GenericValue, boolean).

Delegator.getRelatedCache(String, GenericValue) is replaced by
Delegator.getRelated(String, Map, List, GenericValue, boolean).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343507 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:16:51 +00:00
Adam Heath c9eaf52fc9 FEATURE: Add new Delegator.getRelated that takes a boolean useCache
parameter; all internal calls from GenericDelegator and GenericValue
have been modified to use the new method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343506 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:16:42 +00:00
Adam Heath 5bc50ed5f2 Deprecate GenericValue.getRelatedOne/getRelatedOneCache, and add
a version that takes a cache parameter.

Yet again, another simplication of the delegator api.  This replaces
all simple getRelatedOne type methods with a single version that takes
all possible arguments.

GenericValue.getRelatedOne(String) is replaced by
GenericValue.getRelatedOne(String, boolean).

GenericValue.getRelatedOneCache(String) is replaced by
GenericValue.getRelatedOne(String, boolean).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343504 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:16:26 +00:00
Adam Heath 1aa422773b DEPRECATION: framework: getRelatedOne variants replaced with a getRelatedOne variant that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343478 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:11:19 +00:00
Adam Heath 9e8ddebcac FEATURE: Add GenericValue.getRelatedOne that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343477 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:10:58 +00:00
Adam Heath 7cf7538567 Deprecate all Delegator.getRelatedOne/getRelatedOneCache, and add a
version that takes a cache parameter.

This commit finishes the Delegator.getRelatedOne set of changes; the
previous methods are now deprecated, and the new ones should be used
going forward.

Delegator.getRelatedOne(String, GenericValue) is replaced by
Delegator.getRelatedOne(String, GenericValue, boolean).

Delegator.getRelatedOneCache(String, GenericValue) is replaced by
Delegator.getRelatedOne(String, GenericValue, boolean).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343476 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:10:52 +00:00
Adam Heath 221b2c0312 FEATURE: Add Delegator.getRelatedOne variant that takes a boolean useCache parameter.
Rework internal GenericDelegator methods to call the new method, but no
other external classes directly call this new one yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343475 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:10:44 +00:00
Adam Heath ce8e0a2c24 FIX: Found a local case of findByPrimaryKey usage.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343471 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:09:53 +00:00
Adam Heath 1ba97a3210 FIX: This is the correct fix for 1343088;
TransactionUtil.doNewTransaction was starting a new transaction, then
immediately suspending it.  This caused confusion in calling code that
tried to use doNewTransaction.  Fortunately, this was not used very
much,

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343469 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 03:55:05 +00:00
Adam Heath a2d4b1b5e3 OPTIMIZE: Change return type of noTransaction(Callable) to
NoTransaction; it used to be Callable.  NoTransaction implements
Callable.  This change requires a recompile, but is otherwise
compatible with calling code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343468 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 03:54:58 +00:00
Adam Heath b829aa5d60 FEATURE: Change NoTransaction.call() to throw GenericEntityException
instead of Exception.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343467 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 03:54:51 +00:00
Jacopo Cappellato 247c205188 Improved code that manages the cache:
* replaced putIfAbsent + get with putIfAbsentAndGet to avoid the risk of a NPE if the cache entry is removed (or expired) between the two calls



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343287 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 15:32:28 +00:00
Jacques Le Roux baa73733d2 Where it shows that maintaining help is not that easy. Unlike Javadoc you don't have under eyes when changing things
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343030 13f79535-47bb-0310-9956-ffa450edef68
2012-05-27 10:41:13 +00:00
Jacopo Cappellato 8c28b9751b Modified validation query (executed by DBCP to verify that a connection is valid before borrowing it) to remove dependency on the the "example" component; thanks to Adam Heath and Jacques Le Roux for the suggestions and tests to find out a proper SQL statement (db independent and efficient).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1342310 13f79535-47bb-0310-9956-ffa450edef68
2012-05-24 16:12:05 +00:00
Jacopo Cappellato 748dd94841 Removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340637 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 08:21:18 +00:00
Jacopo Cappellato 79ae52492a Refactored code to use the default BeansWrapper defined by FreemarkerWorker; this is important according to comment from one of the Freemarker committers:
"As of creating new BeansWrapper, be sure you create it only once during the application life-cycle and then reuse the same instance, or else it will have to rebuild the class introspection cache again and again."

Thanks to Adam Heath for the comment.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340631 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 07:49:45 +00:00
Adam Heath abdead8200 Remove errant NOTE for 2008 that was part of a cut-n-waste.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338735 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 14:45:45 +00:00
Adam Heath 6299c90426 Deprecate all Delegator.findByAnd and Delegator.findByAndCache;
introduce a new Delegator.findByAnd variant that takes a boolean cache
parameter.

This change continues the simplication of the delegator api.  There is
no longer a version of a method with a 'Cache' suffix; instead, a single
version now exists that takes a boolean cache parameter.  Also, there
has been a trend to remove several method variants that take different
numbers and types of parameters, instead preferring to fully specify all
parameters; this also continues that trend.

Delegator.findByAnd(String, Map) is replaced with findByAnd(String, Map,
null, false).

Delegator.findByAnd(String, Map, List) is replaced with
findByAnd(String, Map, List, false).

Delegator.findByAnd(String, Object...) is replaced with
findByAnd(String, Map, null, false).  The object array is converted to a
map by using UtilMisc.toMap(Object...).

Delegator.findByAndCache(String, Map) is replaced with findByAnd(String,
Map, null, true).

Delegator.findByAndCache(String, Map, List) is replaced with
findByAnd(String, Map, List, true).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338424 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 21:03:45 +00:00
Adam Heath 9e5f405a4d DEPRECATION: framework: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338403 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:54 +00:00
Adam Heath 321196326a OPTIMIZE: One findByAnd call was calling another findByAnd, instead of
calling findList directly.  This change should speed it up(just
slightly).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338402 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:26 +00:00
Adam Heath 14db0dbfda DEPRECATION: Add new findByAnd variant, that has a boolean useCache
parameter; this is the same similiar pattern that other methods have.

After all code has been modified to use this new method, the older
methods will be deprecated(and eventually replaced).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338400 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:20 +00:00