Commit Graph
1462 Commits
Author SHA1 Message Date
Adam Heath 6676048162 WHITESPACE: Do a bunch of whitespace transformative operations.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141276 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:11:20 +00:00
Adam Heath b0cfef6886 FIX: The generics markup of user and session identifiers was not
correct; someone didn't understand how generics work(if you are casting,
you are most likely doing something wrong; if you are storing Object,
you are most likely doing something wrong).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141275 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:11:11 +00:00
Adam Heath f23be289b5 FIX: In resume(Transaction), there was a block of code commented out
that is supposed to be used on older WebLogic containers.  That code was
actually completely broken.  I've fixed it based on the embedded url,
but can't test it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141274 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:11:04 +00:00
Adam Heath 16f038e010 OPTIMIZE: In class TestOperation, instance variables should be first, then
constructors, before any other methods.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141273 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:10:58 +00:00
Adam Heath f7a186ad56 FIX: Fix some generics warnings I recently introduced.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141271 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29 22:10:47 +00:00
Adam Heath 7e99311694 FEATURE: Add field-set feature to entity engine. You can now
put different fields into different field sets, and when you select any
field in a particular set, all fields in that set will be fetched.  This
also cascades upwards thru views, including alias-all and alias.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139922 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:19:06 +00:00
Adam Heath ce76187cb0 FEATURE: <view-conditon> on <view-link> is now supported.
This allows for LEFT JOINs that have additional filtering applied to
them.  FIXME: not implemented on theta- database types.

This feature depends on the following svn commits: 1139856, 1139869,
1139870, 1139879, 1139919.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139921 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:19:00 +00:00
Adam Heath 9213dd110e FIX/OPTIMIZE: Do column-name munging once, and save the
output, instead of doing it each time the sql string is generated.  This
solidifies the definition of getColValue() and getColName().  colName is
the identifier used to refer to the column, it's generally what comes
after the AS keyword.  colValue is used to the left of AS, and in
CONDITION/ORDER BY/GROUP BY clauses.

This change should allow EntityFieldValue to be rewritten, so it doesn't
have the hack of having to deal with the entityAliasStack.  In theory,
it can just call getColName/getColValue(I'm not certain which is the
correct one for this case).

Also, EntityFieldValue should not have that hack at all, it should have
been put into a completely separate class.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139919 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:15:40 +00:00
Adam Heath c391207fac OPTIMIZE: Switch the database feature detection code to use a loop and a registry
of detectable features.  As a side effect, the output strings are now
aligned.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139918 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:15:34 +00:00
Adam Heath 32f514d948 FIX: Protect against a null return from getFieldDefs().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139888 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:32 +00:00
Adam Heath 0e1df8efa8 FIX: Protect against a null return from getRelations().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139887 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:24 +00:00
Adam Heath 162d94866d FIX: Properly detect if a UNIONED query is being requested.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139886 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:18 +00:00
Adam Heath ecb6e45a0f FIX: Protect against a null return from getFieldAlls().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139885 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:12 +00:00
Adam Heath 23296d0784 FIX: Add the sql excludes to the dynamic view.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139884 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:11:06 +00:00
Adam Heath 0d8288eb1a FIX: Fix NPE when converting a view to xml that was originally created as
a dynamic-view.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139880 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:40 +00:00
Adam Heath 6b73f3e3ac FEATURE: Start passing ModelFieldTypeReader around(nothing
uses it yet, coming soon).  This will allow view entities to do stuff
with field type definitions.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139879 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:29 +00:00
Adam Heath 421ce3102a OPTIMIZE: Optimize ModelConversion looping logic, so that
it's not walking the map's values; instead, do custom management of a
standard array.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139878 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:22 +00:00
Adam Heath c1264c29bf OPTIMIZE: expandAllAliasAlls: Fetch the entityAlias into a
local variable.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139877 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:16 +00:00
Adam Heath d50418875f OPTIMIZE: ViewConditionExpr.createCondition: Use == for EntityOperator
equality, instead of equals(); slight speedup, and the code looks a bit nicer.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139876 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:10 +00:00
Adam Heath 5a648ab76d OPTIMIZE: Lookup the correct condition operator in the
constructor for view condition classes.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139875 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:04 +00:00
Adam Heath 7d82390c68 OPTIMIZE: Changed a bunch of errors/warnings/exceptions to be more
consistent, and prefix each message with [entityName] so that fixing the
problem in the model definition becomes easier.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139874 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:57 +00:00
Adam Heath eb657bf2b5 OPTIMIZE: Make a bunch of support classes in ModelView be final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139873 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:50 +00:00
Adam Heath 151fd9e428 FEATURE: Allow for setting the ViewEntityCondition on
ModelViewLink programmatically.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139872 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:44 +00:00
Adam Heath c693076ab6 FIX: Fix NPE in ModelAliasAll.iterator(), when
fieldsToExclude is null.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139871 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:38 +00:00
Adam Heath a4fbfd05ec FIX: EntityFieldValue has a helper method for fetching the
ModelField; use that instead of fetching the ModelField directly from
the entity.  This is a fix for view-conditions, as the EntityFieldValue
has an internal ModelViewEntity that it uses to fetch the field;
fetching the raw fieldName was not correct in these cases.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139870 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:09:32 +00:00
Adam Heath f75220c219 FIX: getModelField: when fetching the ModelField, handle the
case of the field being part of a ModelViewEntity.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139869 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:53 +00:00
Adam Heath 939c932983 OPTIMIZE: ViewEntityCondition.createCondition: fetch the lhs
field into a local variable.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139868 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:48 +00:00
Adam Heath 3338c7743d OPTIMIZE: ViewEntityCondition.createCondition: move the
fetching of lhs a little bit earlier.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139867 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:08:42 +00:00
Adam Heath 8fba300516 FIX: When the rhs was an EntityFieldValue, the wrong model field was being
checked(it was checking the left field).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139856 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:07:44 +00:00
Adam Heath 0653d3a7d1 FEATURE: When doing bulk creation of tables, foreign key indices,
and declared indices, do the work in parallel.  Also, when the database
does not support wildcard looking of primary key info, do the per-table
lookup in parallel.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139851 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:07:18 +00:00
Adam Heath 1af60a7143 FEATURE: Add a thread pool to GenericHelper; this is per datasource.
Nothing makes use of this yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139700 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 02:50:49 +00:00
Jacques Le Roux 7a9e80e6ef A patch from Leon "Trivial patch to ModelViewEntity class to make view entity able to handle entity condition between field from one entity and another" https://issues.apache.org/jira/browse/OFBIZ-4321
In view entity definition, we can use <condition-expr> to create a filter condition between field and some value using specific operator. It should be also possible to make condition between field and rel-field through some kind operator. Such as:

<view-entity entity-name="xxx" package-name="xxx">
        ...
        <entity-condition>
            <condition-expr entity-alias="A" field-name="a" operator="equals" rel-entity-alias="B" rel-field-name="b"  />
        </entity-condition>
    </view-entity>

But there's a trivial defect in current ModelViewEntity which prevent this case working.

} else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
                return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
            } else {

In the above code extracted from ModelViewEntity, it does not consider the condition that the relField could be defined when value==null.

JLR:I checked that || should not be used in <<value == null && this.relFieldName>>, it was not obvious to me but is correct

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1137201 13f79535-47bb-0310-9956-ffa450edef68
2011-06-18 15:17:22 +00:00
Erwan de Ferrieres e1c4ec0c5d when sorting on more than 1 criteria, only the last one was used
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1136833 13f79535-47bb-0310-9956-ffa450edef68
2011-06-17 10:06:50 +00:00
Jacques Le Roux e6539dc8fc Closes "JmsTopicListener started twice when distributed-cache-clear is active" reported by Martin Kreidenweis at https://issues.apache.org/jira/browse/OFBIZ-4296
Simply avoid to start a JMS Listener thread from Job Manager when DCC is on. Then set it back to previous value.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1131144 13f79535-47bb-0310-9956-ffa450edef68
2011-06-03 19:05:07 +00:00
Marco Risaliti c44b4beb0f Removed some javadoc warning (wrong param/return) into entity component no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1126715 13f79535-47bb-0310-9956-ffa450edef68
2011-05-23 20:23:32 +00:00
Jacques Le Roux 0bc35e7275 A patch from Martin Kreidenweis "NullPointerException in GenericDelegator during testMode rollback" https://issues.apache.org/jira/browse/OFBIZ-4284
Test mode rollback doesn't work right in GenericDelegator for calls to removeByPrimary() key and removeByValue() when the row to be deleted didn't exist in the first place. It creates a TestOperation with a null value and subsequently fails to create that during rollback.

First, the TestOperation shouldn't be created at all. Second, if null is passed to GenericDelegator.create() it tries to handle this, but fails with a NullPointerException.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1104423 13f79535-47bb-0310-9956-ffa450edef68
2011-05-17 17:25:52 +00:00
Jacques Le Roux 87f0cfbb36 I got caught by this typo on a production cluster:
XmlFileLoader: File file:.....framework/entity/config/entityengine.xml process fatal error. Line: 686. Error message: Invalid byte 2 of 2-byte UTF-8 sequence.

After having manually put back the line modified by an automatically applied patch, I got this  mis-representation. Not sure why, and anyway had no chances to think about it (certainly due to a difference on how UTF-8 was represented on these servers and on my machine - XP with Putty and SSH)

So I remove this weirdness to prevent future possible nervous crises ;o)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1104173 13f79535-47bb-0310-9956-ffa450edef68
2011-05-17 11:54:11 +00:00
Erwan de Ferrieres 07a566932d Upgrading derby to 10.8.1.2 - changelog is here http://db.apache.org/derby/releases/release-10.8.1.2.cgi
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1103767 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 15:27:39 +00:00
Jacques Le Roux 5c8fbb779d Fix the comment of the not-null attribute (field element)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1100729 13f79535-47bb-0310-9956-ffa450edef68
2011-05-08 13:01:30 +00:00
Jacques Le Roux f90dcae786 Add an explicit comment about use-indices-unique="false" which is needed because of Derby bug with null values in a unique index
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1099727 13f79535-47bb-0310-9956-ffa450edef68
2011-05-05 09:09:39 +00:00
Jacques Le Roux 0f99d5d983 I did it wrong in r1094600 and just noticed
<<Slight improvement to prevent false error messages when putting spaces in readers names, eg after commas for instance>>




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1097712 13f79535-47bb-0310-9956-ffa450edef68
2011-04-29 07:43:56 +00:00
Adrian Crum 79a144483d Bug fix: Entity ModelInfo default info was not working.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1095029 13f79535-47bb-0310-9956-ffa450edef68
2011-04-19 11:17:01 +00:00
Jacques Le Roux 4ba28611c0 Slight improvement to prevent false error messages when putting spaces in readers names, eg after commas for instance
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1094600 13f79535-47bb-0310-9956-ffa450edef68
2011-04-18 14:40:15 +00:00
Jacques Le Roux a3a109e366 A patch from Sascha Rodekamp "Infinite loop when instantiate the delegator using distributetCacheClear" https://issues.apache.org/jira/browse/OFBIZ-3987
We found an infinite loop when instantiate the delegator. This happens when you use the distributetCacheClear .
I moved the init of the dist cache clear to a separate method and call it in the factory which resolves the loop issue.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1090952 13f79535-47bb-0310-9956-ffa450edef68
2011-04-11 07:03:32 +00:00
Hans Bakker 4931953320 Extended error message
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1090909 13f79535-47bb-0310-9956-ffa450edef68
2011-04-10 23:24:12 +00:00
David E. Jones 8f80abdb52 Added code to keep track of where transactions are suspended to help diagnose lock wair timeout types of errors; also small cleanup with new getSuspendedTxStack instead of that code duplicated for each method
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1088875 13f79535-47bb-0310-9956-ffa450edef68
2011-04-05 03:32:07 +00:00
Jacques Le Roux df2c499190 Better handling of the sql-timestamp case (follow ISO format by default)
sql-Timestamp is defined as xsd:dateTime in ModelService.getTypes(), so try to parse the value as xsd:dateTime first.  
Fallback is java.sql.Timestamp because it has been this way before.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1087883 13f79535-47bb-0310-9956-ffa450edef68
2011-04-01 20:22:46 +00:00
Scott Gray 686033475f Added check for presence of the max-idle attribute before attempting to parse its value
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1081689 13f79535-47bb-0310-9956-ffa450edef68
2011-03-15 09:08:28 +00:00
Sascha Rodekamp 4ce5654fc9 Improvement - Added a new method: getRelatedByAndCache because there is only a methode getRelatedByAnd which uses no cache.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1079456 13f79535-47bb-0310-9956-ffa450edef68
2011-03-08 18:09:47 +00:00
Marco Risaliti 582b2b4cca Remove some warning in GenericDelegator (OFBIZ-4102)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1078214 13f79535-47bb-0310-9956-ffa450edef68
2011-03-04 23:22:13 +00:00