Adrian Crum
5832bcd719
Small performance enhancement to the entity engine converter code. If a SQL->Java converter is needed, keep a reference to it in ModelFieldType.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@880957 13f79535-47bb-0310-9956-ffa450edef68
2009-11-16 21:09:34 +00:00
Adam Heath
35edfbc498
Removed space from jar name.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@880879 13f79535-47bb-0310-9956-ffa450edef68
2009-11-16 18:00:46 +00:00
Adam Heath
91050d9263
Very large update. SQL parser is fairly generic now. Can parse sql
...
that is compatible with features used by ofbiz. Has support for
DELETE, INSERT, INSERT SELECT, SELECT, UPDATE, and VIEW.
Modified the delegator side of the above to handle the new
interfaces. Now supports complex alias. Only SELECT is supported,
and the parseCondition code is disabled for the time being.
The plan(sic) here is to obviously support the other sql statements.
Then, to have a jdbc wrapper around all this, so external tools, that
only know how to talk jdbc, can actually talk directly to the
delegator.
Plus, many more people can understand sql syntax. This allows them
to do things with ofbiz, that they would find much more difficult if
they had to write <view-entity> definitions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@880835 13f79535-47bb-0310-9956-ffa450edef68
2009-11-16 16:31:32 +00:00
Adrian Crum
10f5cf54d7
The first step in getting the entity engine to use the new Java object type conversion code. Right now it only works while getting values from the database.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836415 13f79535-47bb-0310-9956-ffa450edef68
2009-11-15 20:47:42 +00:00
Adam Heath
14c9b6f7f4
Support complex aliases now. Note, that string default values do not
...
work corretly, and ModelViewEntity does not do any encoding of the
value, and this parser doesn't handle that.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836088 13f79535-47bb-0310-9956-ffa450edef68
2009-11-14 01:15:56 +00:00
Adam Heath
6003fb0cf5
Helper method to add several complex alias members.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836086 13f79535-47bb-0310-9956-ffa450edef68
2009-11-14 01:14:49 +00:00
Adam Heath
8be78c2804
Add aggregate function support for field definitions.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836073 13f79535-47bb-0310-9956-ffa450edef68
2009-11-14 00:13:09 +00:00
Jacques Le Roux
2e4130844b
commons-dbcp-1.3-20091113-r835956 .jar replaces commons-dbcp-1.3-20080708-r674758.jar
...
Built directly from DBCP trunk. Compiles with jdk 1.5 and 1.6 as well, runs also with both
An initiative from Philippe Mouawad at "Memory leak due to transaction management" (https://issues.apache.org/jira/browse/OFBIZ-2599 ) - OFBIZ-2599
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836015 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 22:00:12 +00:00
Adam Heath
d17a8bf5c6
Make AND have a higher priority than OR.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835938 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 17:44:44 +00:00
Adam Heath
8bafb94b7e
Implement list values, and handle between(needed to be special cased).
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835934 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 17:28:35 +00:00
Adam Heath
cc340041ce
Implement relations in xml output.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835933 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 17:27:29 +00:00
Jacques Le Roux
6e89a069e7
Revert r835394 (DBCP upgrade, issue compiling with jdk 1.5 OOTB)
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835801 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 10:28:29 +00:00
Adam Heath
b33013c644
Add shorthand for keymap lists, making use of "USING".
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835792 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 09:47:58 +00:00
Adam Heath
4a141e10fe
Add <TYPE> to NamePart(); the other words should also be added here.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835787 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 09:21:41 +00:00
Adam Heath
38d0d601ba
Add relation support. Not fully correct, as one-nofk is not yet
...
supported, because of the '-' in the name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835786 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 09:20:15 +00:00
Adam Heath
a4a9095e69
Fix creation when title=null.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835785 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 09:18:17 +00:00
Adam Heath
d5c53231e9
Inline AllField and FieldDef, which lets LOOKAHEAD be removed.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835768 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 07:47:04 +00:00
Adam Heath
8c84c6c554
Methods to convert dynamic views back to xml.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835764 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 07:20:15 +00:00
Adam Heath
eace82a28c
Fix KeyMaps(), duplicate keymap in the returned list.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835762 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 07:15:20 +00:00
Adam Heath
4cfae426e4
Create a method to parse stand-alone conditions.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835748 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 05:39:11 +00:00
Adam Heath
dc56406606
Support sub conditions with ().
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835747 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 05:38:18 +00:00
Adam Heath
c8f1e223c8
No longer use jjtree to implement parsing. As a consequence of this,
...
SQLSelect no longer depended on Parser, so javac wouldn't compile the
generated code. SQLUtil was added to deal with this(this class will
get more helpers later).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835741 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 04:55:55 +00:00
Adam Heath
65b2182293
Implement ORDER BY and GROUP BY; also, multiple joins work now.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835731 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 04:08:59 +00:00
Adam Heath
4e69fb0764
Allow for setting groupBy fields with just a simple list.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835729 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 03:59:34 +00:00
Adam Heath
205d63f9fc
<NAME> actually swallows all name parts, don't need to loop in NamePart.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835649 13f79535-47bb-0310-9956-ffa450edef68
2009-11-13 00:01:23 +00:00
Adam Heath
43948cfff3
Store the DynamicViewEntity into the SQLSelect node.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835648 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 23:59:11 +00:00
Adam Heath
b15bba608f
Start of new sql parsing code. Not completely tested. It *does* parse
...
a test SELECT; what is not tested is actually running the built
DynamicViewEntity.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835637 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 23:23:12 +00:00
Adam Heath
afee8ad000
Register the comparison operators with their punctuation variants.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835636 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 23:21:29 +00:00
Adam Heath
64b4ccc5f7
Oops, didn't do a clean/ant run, and broke this when
...
AbstractCollectionConverter was removed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835476 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 17:56:39 +00:00
Adam Heath
edf7210d88
Remove extraneous blank lines, and trailing whitespace.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835451 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 17:12:02 +00:00
Jacques Le Roux
7786dd9bfb
commons-dbcp-1.3-20091111-r834702.jar built directly from DBCP trunk. An initiative from Philippe Mouawad at "Memory leak due to transaction management" ( https://issues.apache.org/jira/browse/OFBIZ-2599 ) - OFBIZ-2599
...
We are been using Ofbiz with DBCP based implementation.
Ofbiz uses a Head revision of DBCP (package org.apache.commons.dbcp.managed is the same as current TRUNK) and geronimo-transaction-1.0.
We are having recurrent OutOfMemory which occur on a 2 days basis.
See: https://issues.apache.org/jira/browse/DBCP-294
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835394 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 14:39:43 +00:00
Jacques Le Roux
0bd14b407c
A patch from Bob Morley "When an entityModel has a field marked as a primary key, it should also be set to NotNull" ( https://issues.apache.org/jira/browse/OFBIZ-3154 ) - OFBIZ-3154
...
We were doing some work with the ModelField and noticed that when a field is marked as a primary key it can still have its "NotNull" property set to "false" (the default). Because we were doing work based on if a field was nullable it was causing a bug on primary keys. The suggestion is to set NotNull = "true" when a field is marked as a primary key. This should have no impact to current code as (in most places) a redundant check was being done (see creation of tables where it will add "NOT NULL" based on both isNotNull and isPk – ideally it should be just based on the former).
This change makes minor modifications to two files ModelField and ModelEntity. ModelField.setIsPk() will call setIsNotNull(true) when the primary key indicator is true. ModelEntity will call field.isNotNull = true when it is reading the primary key elements in the entity definition.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835303 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 08:49:27 +00:00
Adam Heath
172a135a56
Move getSourceClass and getTargetClass into the base class; removes a
...
bunch of code. This also nescessitated the creation of a helper class
for collection containment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835164 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 23:47:03 +00:00
Adrian Crum
a55f49fce5
More improvements to the conversion framework, plus bug fixes.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835032 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 19:35:34 +00:00
Adrian Crum
ae236a6b7d
Conversion framework improvements, fixed bugs reported on mailing list.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@834978 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 17:45:33 +00:00
Adrian Crum
7ec17ed148
Some work on CachedClassLoader.java. Fixed non-thread-safe code, converted HashMap and HashSet to Javolution classes, added a registerClass method, and simplified the Init interface.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@834727 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 00:39:44 +00:00
Adrian Crum
ee835d014a
Added Java type converters for the entity engine.
...
This commit demonstrates how the object type converter framework can be extended by other components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@833964 13f79535-47bb-0310-9956-ffa450edef68
2009-11-09 01:48:23 +00:00
Jacques Le Roux
2d14996c3a
A patch from Bob Morley " Resolve widget action entity caching with filter-by-date" ( https://issues.apache.org/jira/browse/OFBIZ-3090 ) - OFBIZ-3090
...
When you attempt to get a cached result in an action block with "filter-by-date" turned on, caching never occurs because the date/time changes with each request. Recommended solution is when use-cache and filter-by-date are both true, we will create a condition w/o the date restriction, execute the (cachable) query, and then use the EntityUtil to filter by date.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@832908 13f79535-47bb-0310-9956-ffa450edef68
2009-11-04 23:35:48 +00:00
Jacques Le Roux
33f843c771
A patch from Matarazzo Angelo "Remove an useless EntitySubSelect warning message." ( https://issues.apache.org/jira/browse/OFBIZ-3145 ) - OFBIZ-3145
...
With the same security kept
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@832880 13f79535-47bb-0310-9956-ffa450edef68
2009-11-04 21:56:34 +00:00
Adrian Crum
f30d44ccdc
TimeDuration.java improvements. This is the first step in a duration data type implementation discussed here - https://issues.apache.org/jira/browse/OFBIZ-3125 .
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@832574 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 21:58:00 +00:00
Adrian Crum
9ee18d37c5
Updated client code to use the new Delegator factory method.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@823633 13f79535-47bb-0310-9956-ffa450edef68
2009-10-09 17:44:24 +00:00
Adam Heath
7f94829d66
Don't use the internal CacheLine value iterator, instead iterating
...
over the keys, fetching the value, and then removing when it matches.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@823319 13f79535-47bb-0310-9956-ffa450edef68
2009-10-08 20:49:17 +00:00
Adam Heath
f4ce5e6276
Remove unneeded CacheLine import.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@823317 13f79535-47bb-0310-9956-ffa450edef68
2009-10-08 20:48:43 +00:00
Adam Heath
3162462a72
Remove protected method, that isn't used.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@823289 13f79535-47bb-0310-9956-ffa450edef68
2009-10-08 19:38:29 +00:00
Scott Gray
ca09f69b94
Fix an inconsistency in GenericEntity's get methods when the key doesn't exist, get(String) throws an exception but get(Object) just logs a warning. Changed so that both methods just log a warning.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@822276 13f79535-47bb-0310-9956-ffa450edef68
2009-10-06 14:07:04 +00:00
Adam Heath
b15b30ddfd
Simple factory lookup, DelegatorFactory switched to abstract class.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821669 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 03:00:11 +00:00
Adrian Crum
7fa08f9079
Replaced GenericDelegator.getGenericDelegator(...) calls with new factory method.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821649 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 01:53:50 +00:00
Adrian Crum
a4d68934c9
Converted GenericDelegator concrete class references to Delegator interface references.
...
This commit requires ant clean. Also, external libraries that reference GenericDelegator will need to be updated.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821643 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 00:08:27 +00:00
Adam Heath
db585f5d95
Oops, shouldn't have checked these 2 lines in.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821577 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 19:04:08 +00:00
Adam Heath
11df2b159a
Make 2 reusable schema types, boolean, and aggregate-function.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821576 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 19:01:44 +00:00