Jacques Le Roux
1956e731a3
No functional changes, only formatting.
...
While looking for other cases like r1459222 and r1509164 introduced by r1300812 and r1305309. I noticed there were a lot of wrong for loops formatting (miss a white space after for), this changes it
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1511742 13f79535-47bb-0310-9956-ffa450edef68
2013-08-08 12:28:01 +00:00
Adam Heath
d950b6fb05
FEATURE: Allow constant numbers to be directly added to a query, instead
...
of having to deal with some kind of map/generic value. This makes it
simpler to use full-text-search queries thru the entity
engine(postgresql and oracle).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497893 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:39 +00:00
Adam Heath
8a497262d9
FIX: If using <extend-entity> to change the type of a pre-existing
...
field, then we need to be certain to remove the existing defined field
from the list of available fields. Otherwise, you'll end up with the
same field being queried in SELECT, and the same field being updated in
INSERT or UPDATE.
This issue was discovered when changing the type of a pre-existing
field(so that the length of the field could be increased).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497889 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:09 +00:00
Adrian Crum
c60b808b92
Reverting rev 1486552:
...
https://issues.apache.org/jira/browse/OFBIZ-5214
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491170 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 10:04:15 +00:00
Adrian Crum
c1c2028fd4
Fixed a thread deadlock issue that seems to be specific to loading the MS SQL JDBC driver.
...
https://issues.apache.org/jira/browse/OFBIZ-5216
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491165 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 09:24:49 +00:00
Adrian Crum
06ec6b5eaf
Removed some code I introduced in recent commits where I was hoping to support reloading the entityengine.xml file in a controlled manor, but it seems to be causing thread deadlocks.
...
https://issues.apache.org/jira/browse/OFBIZ-5216
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490965 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 11:55:12 +00:00
Adrian Crum
91949082c1
Cleaned up the auto-generated code in the entity config models.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490940 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 10:00:45 +00:00
Adrian Crum
18b5135a31
Third pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490938 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 09:34:47 +00:00
Adrian Crum
964a1d956d
Second pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490678 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 15:18:27 +00:00
Adrian Crum
7b84188235
First pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models. I also fixed some concurrency problems in related classes by replacing DCL with java.util.concurrent classes. I discovered the new multi-threaded component loader was creating duplicate resources, so these changes fix that.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490541 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 08:39:44 +00:00
Adrian Crum
a2622d1d37
Improved entityengine.xml models:
...
1. Added file name and line number to validation code so exceptions can show where things went wrong.
2. Convert some attributes to primitive types.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490535 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 08:21:22 +00:00
Adrian Crum
767deefce4
New models for the entityengine.xml file. These will be used to replace the DOM caching/parsing code in the same way as the service engine.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490187 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 08:02:14 +00:00
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