Adrian Crum
f1a85663d1
Entity engine optimization: Use SELECT * when the fields to select have not been specified.
...
There was some code to check for this, but it was testing a "fields to select" List that was never empty, so SELECT * was never used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1486552 13f79535-47bb-0310-9956-ffa450edef68
2013-05-27 09:49:02 +00:00
Adrian Crum
fa77ee6655
Fixed a bug in the entity engine pk cache where view entities went stale - https://issues.apache.org/jira/browse/OFBIZ-5192 .
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1484279 13f79535-47bb-0310-9956-ffa450edef68
2013-05-19 12:29:44 +00:00
Jacques Le Roux
8ca89fc25d
Reverts r1482796 and comments about no current implementation rather than removing attributes
...
Thanks to Jacopo's comment in dev ML
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482911 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 15:38:43 +00:00
Jacques Le Roux
3abb2933d6
When I moved XA Pool to the Attic I forgot to remove these XA Pool specific attributes. They were now misleading.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482796 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 12:50:54 +00:00
Adam Heath
7b9961afcd
FEATURE: In NoTransaction.call, completely unwrap all nested exceptions, and re-wrap the innermost one. This is just like InTransaction.call.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482509 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:09:38 +00:00
Adam Heath
a4b4054c77
FEATURE: Remove use of empty ArrayList/HashMap, instead using
...
Collections emptyList/emptyMap.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482441 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 16:38:30 +00:00
Adam Heath
dbfb52c701
FORMATTING: Improve formatting; no single-line if, use {} for if.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482440 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 16:38:23 +00:00
Adam Heath
8b9c0e537b
OPTIMIZE: Remove all SuppressWarnings("unchecked") from the entity
...
engine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482152 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 23:52:52 +00:00
Adam Heath
432ce20711
FEATURE: Switch derby <inline-jdbc> to use the external
...
passwords.properties.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482057 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:59 +00:00
Adam Heath
158bc8b1de
FEATURE: Allow for passwords in entityengine.xml to come from an
...
external passwords.properties file; nothing actually uses this yet,
however.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482056 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:51 +00:00
Adam Heath
5f7e967d2c
OPTIMIZE: Move the fetching of the jdbc-password attribute into a single
...
global static method. Soon, this logic will be changed to support
looking the password up in an external file, so that security can be
imported.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482055 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:43 +00:00
Adam Heath
7e7d53af0f
FEATURE: Add getFirst/getOnly variants that take a collection.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482005 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:02:16 +00:00
Adam Heath
7beb84c605
FEATURE: getFirst/getOnly now use UtilValidate to verify non-emptiness.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482004 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:02:08 +00:00
Adam Heath
4aaf4f720d
FEATURE: When there is no configured eca handler configured, only print
...
out the warning once, instead of on every single call. This actually
gives a rather impressive performance improvement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482002 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:01:54 +00:00
Adrian Crum
eb7dd6969a
Improvements to the ModelRelation and ModelKeyMap classes. Now the entity engine can accurately detect duplicate relations.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1481518 13f79535-47bb-0310-9956-ffa450edef68
2013-05-12 10:52:55 +00:00
Adrian Crum
df4f66cf6b
Reverted revision 1480891 and fixed the problem it tried to fix.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1481367 13f79535-47bb-0310-9956-ffa450edef68
2013-05-11 16:12:05 +00:00
Adrian Crum
06cc7b2e41
Remove Javolution from ModelViewEntity.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1478620 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 01:02:56 +00:00
Adrian Crum
cdccca8bd1
Made ModelInfo immutable, modified ModelEntity so it contains ModelInfo instead of extending it.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1478302 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 08:51:09 +00:00
Adrian Crum
2a5ccbb63b
Moving toward immutable entity model classes. Also some code cleanups, simplified API, and JavaDocs.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1477929 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 08:16:56 +00:00
Adrian Crum
6943eeb11d
A small overhaul for the ModelEntity class. The class is not thread-safe. Worse, there were four ModelField-related collections that were not updated consistently - causing invalid data. Two of the collections (field list and field map) were redundant, so I eliminated one.
...
This is a step toward thread-safety, but the class still isn't thread-safe. It would be best if this class was immutable, but that will require a lot of re-engineering.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1476826 13f79535-47bb-0310-9956-ffa450edef68
2013-04-28 20:10:02 +00:00
Adrian Crum
e68964ce58
Pull up some data and methods from GenericValue to GenericEntity. GenericValue is now a GenericEntity with some convenience methods.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1476745 13f79535-47bb-0310-9956-ffa450edef68
2013-04-28 09:47:32 +00:00
Adrian Crum
94669d6bbe
Some bug fixes for entity engine caches. GenericDelegator was inconsistent in clearing caches - some methods cleared the cache before the entity operation (wrong) while others cleared the cache after the entity operation (right). Also, I updated the Delegator JavaDocs to warn against skipping the cache clearing step - which shouldn't be done. Finally, the AbstractEntityConditionCache.storeHook method doesn't work (for a number of reasons) so I bypassed it.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1476296 13f79535-47bb-0310-9956-ffa450edef68
2013-04-26 17:04:49 +00:00
Adrian Crum
3e3b50c688
Removed the "embedded relation cache" from GenericValue because it is a bad idea and doesn't work. There was no code to keep the embedded cache current as the GenericValue's fields changed - so the cache contents are guaranteed to be invalid (stale).
...
If we want to improve the performance of relation lookups, then there are better ways to do it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1471739 13f79535-47bb-0310-9956-ffa450edef68
2013-04-24 22:21:06 +00:00
Adrian Crum
4f1b5184e6
More work on GenericEntity and GenericValue immutability.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1471687 13f79535-47bb-0310-9956-ffa450edef68
2013-04-24 21:23:12 +00:00
Adrian Crum
2fce4a0c74
GenericEntity instances coming from EntityListCache are now immutable.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1471284 13f79535-47bb-0310-9956-ffa450edef68
2013-04-24 08:11:53 +00:00
Adrian Crum
9db5a99f31
Let's try this again...
...
Make sure an immutable GenericEntity really is immutable. Also fixed deserialization of the new Observable object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1471283 13f79535-47bb-0310-9956-ffa450edef68
2013-04-24 08:07:36 +00:00
Adrian Crum
ea766e0b2f
Reverting revision 1470712. The improved immutability is causing problems in some places.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470845 13f79535-47bb-0310-9956-ffa450edef68
2013-04-23 08:23:57 +00:00
Adrian Crum
c12f49f4aa
Reverting revision 1470736 which was causing some tests to fail.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470827 13f79535-47bb-0310-9956-ffa450edef68
2013-04-23 06:54:17 +00:00
Adrian Crum
ce645e6568
JavaDocs and some small fixups for my previous commits.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470747 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 23:00:47 +00:00
Adrian Crum
7179221b1c
GenericEntity instances coming from EntityListCache are now immutable.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470736 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 22:14:07 +00:00
Adrian Crum
f2aa5d4d87
Removed unnecessary synchronized keyword. The GenericEntity class is not thread-safe, so synchronizing a single method is pointless.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470732 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 21:56:03 +00:00
Adrian Crum
45cec54c55
Make sure an immutable GenericEntity really is immutable.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470712 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 20:46:36 +00:00
Adrian Crum
bdc155f896
Copy the observable aspect of GenericEntity. Includes unit tests. Also added some FIXME comments.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470676 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 19:38:06 +00:00
Adrian Crum
5c290a7408
Refactored GenericEntity so it contains Observable instead of extending Observable. This will enable copying the Observable aspect of the class.
...
Also replaced java.util.Observable with org.ofbiz.base.util.Observable. Anyone using the Observable functionality will need to change their imports.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470392 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 06:29:19 +00:00
Adrian Crum
41137d0650
Oops, I missed a file in my last commit.
...
Moved the OperationType enum to the Delegator interface so it can be reused.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470386 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 05:02:03 +00:00
Adrian Crum
94be7afbff
Moved the OperationType enum to the Delegator interface so it can be reused.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470385 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 04:52:52 +00:00
Adrian Crum
9d914eda61
Remove Javolution from GenericPK.java.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470383 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 03:46:30 +00:00
Adrian Crum
3ed3b1238b
Added an entity cache unit test.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470274 13f79535-47bb-0310-9956-ffa450edef68
2013-04-21 09:02:13 +00:00
Adrian Crum
2f5023231a
Small optimization in GenericDelegator makeValidValue method - invoke GenericValue.setAllFields once instead of twice.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1467752 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 09:41:48 +00:00
Adrian Crum
65d38cdaf6
Removed most of Javolution from the entity engine. There are some Javolution classes I am not familiar with, so I will replace those after I do some research.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1467744 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 08:16:46 +00:00
Adrian Crum
055f996b8e
Revert some unintentional changes from my last commit.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465431 13f79535-47bb-0310-9956-ffa450edef68
2013-04-07 17:22:59 +00:00
Adrian Crum
03084330a8
Merged rev 1462755 from the 2013_RemoveJavolution branch.
...
Removed Javolution from Mini-language.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465427 13f79535-47bb-0310-9956-ffa450edef68
2013-04-07 17:15:10 +00:00
Adrian Crum
24f64fe28b
Log message cleanup in ModelReader.java.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1463859 13f79535-47bb-0310-9956-ffa450edef68
2013-04-03 07:55:02 +00:00
Jacques Le Roux
7c323b902d
A refactored patch from Leon for "Bug introduced by OFBIZ-4769, it makes <entity-one> failed if the context contains incorrect data" https://issues.apache.org/jira/browse/OFBIZ-5148
...
How to reproduce:
1. open "https://demo-trunk.ofbiz.apache.org/partymgr/control/editpartygroup?create_new=Y " (try to create a new party group)
2. input any words in group name field, input any "incorrect" non-digits characters (e.g. "abcd" blah blah) to field "Annual revenue"
3. click save
It leads to an "exception" page instead of original input form with error message.
I digged some codes and found it's related to r1426231 commit (of OFBIZ-4769).
jleroux: the logic of code seemed good to me, I just refactored the cod a bit (in a previous refactoring attempt I missed the point that parametersObjExists might not be present. This new code is a simplified version of what does setAllFields internally. The PK fieldValues are set before being possibly overriden by context values. There is no Map casting. I tested the previous issues, all are resolved.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1462948 13f79535-47bb-0310-9956-ffa450edef68
2013-03-31 13:41:34 +00:00
Jacques Le Roux
0e341837a5
Revert r1462902, there are 3 tests failing and I have not the time to look at it yet
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1462912 13f79535-47bb-0310-9956-ffa450edef68
2013-03-31 10:27:41 +00:00
Jacques Le Roux
a4d71dd61e
A refactored patch from Leon for "Bug introduced by OFBIZ-4769, it makes <entity-one> failed if the context contains incorrect data" https://issues.apache.org/jira/browse/OFBIZ-5148
...
How to reproduce:
1. open "https://demo-trunk.ofbiz.apache.org/partymgr/control/editpartygroup?create_new=Y " (try to create a new party group)
2. input any words in group name field, input any "incorrect" non-digits characters (e.g. "abcd" blah blah) to field "Annual revenue"
3. click save
It leads to an "exception" page instead of original input form with error message.
I digged some codes and found it's related to r1426231 commit (of OFBIZ-4769).
jleroux: the logic of code seemed good to me, I just refactored the cod a bit. This new code is a simplified version of what does setAllFields internally. The PK fieldValues are set before being possibly overriden by context values. There is no Map casting. I tested the previous issues, all are resolved.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1462902 13f79535-47bb-0310-9956-ffa450edef68
2013-03-31 09:20:30 +00:00
Paul Foxworthy
efd5104e1d
Fix spelling of successful and some other words
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460654 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 13:33:09 +00:00
Paul Foxworthy
94c2bac40f
reapplied Adrian's change r1460455
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460652 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 13:26:42 +00:00
Paul Foxworthy
0079816733
Undid r1460637, should be two separate commits
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460647 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 13:14:10 +00:00
Paul Foxworthy
4882b2b62d
Add grams to Product Shipment Uom labels (Jira OFBIZ-5154)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1460637 13f79535-47bb-0310-9956-ffa450edef68
2013-03-25 12:46:16 +00:00