Commit Graph
647 Commits
Author SHA1 Message Date
Erwan de Ferrieres 5b949ffeb3 OFBIZ-3911 - A patch from Nicolas Malin -- Correct ij.ofbiz script with derby 10.6.1.0
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@991114 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 08:02:59 +00:00
Scott Gray f79f17b18a Completed the fix reported in r989475 (and subsequently reverted in r989722) by Erwan.
The condition-object element used to have an attribute named "field-name" which was later replaced with "field" but the code was instead checking for "field-name" and then "name".
Fixed so that the code checks for "field" and then "field-name".

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@990347 13f79535-47bb-0310-9956-ffa450edef68
2010-08-28 11:35:24 +00:00
Erwan de Ferrieres 6d59cc8f25 reverting 989475 as it is generating too much backward compatibility issues
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@989772 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 15:41:49 +00:00
Erwan de Ferrieres d6564a8188 when using an entity-condition, the object's attribute name used in condition object parameter was not taken into account
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@989475 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 07:07:12 +00:00
Jacques Le Roux c04f9410df Resolve issues from r985624 (only ReadCommitted for HSQL should have been changed)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@985639 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 09:30:38 +00:00
Jacques Le Roux 9315590611 Checking entityengine.xml I found that, by default, only HSQL uses isolation-level="ReadUncommitted" while all others use
isolation-level="ReadCommitted". Since its version 2.0, HSQL now supports ReadCommitted. 

http://en.wikipedia.org/wiki/HSQLDB


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@985624 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 07:59:16 +00:00
Adam Heath a633201428 Different entity groups can point to the same helper. However, since
the entities defined in the group are what is passed to the helper for
checking, it makes no sense to have protection against a helper from
being checked multiple times.

Ideally, the proper fix would be to find all groups by helper, combine
all the entities together, then pass them to the helper in one shot.
However, with the new tenant system, this grouping needs to be done by
target database uri(and other parameters), not by helper name.  This
might get done later.

Before this commit, any ofbiz installation that put multiple entity
groups into the same helper would only have the entities from the first
group get created.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@985298 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 17:42:51 +00:00
Adam Heath d06f72f7f9 FEATURE: Start of union support; parsing isn't tested yet.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981640 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:44:20 +00:00
Adam Heath 066b0716d8 Expose a helper method for parsing order by items.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981635 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 17:43:47 +00:00
Scott Gray 10a56ea013 Copied CommonWorkers.hasParentType(...) over to EntityTypeUtil and deprecated the method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981446 13f79535-47bb-0310-9956-ffa450edef68
2010-08-02 10:47:26 +00:00
Adam Heath 66b76faf4e The database check attempted to only check each helper once; however,
the Set used to track whether a helper had been checked was *inside* the
loop, so this optimization never actually did what was intended.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981123 13f79535-47bb-0310-9956-ffa450edef68
2010-08-01 03:08:07 +00:00
Jacopo Cappellato 2a7d97b45d Always close the stream of the xml file after the parsing is done: this fixes a bug where the file was not deleted when it was successfully imported at the second or third attempt.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981028 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 10:13:49 +00:00
Scott Gray 4448c4a866 No functional changes, just removing a whole bunch of unused imports and reorganizing them along the way.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981019 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 08:28:34 +00:00
Scott Gray e3d73f77ff Must have decided to finish the comments after adding the method to git's index, committing the rest of the comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981009 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 05:48:36 +00:00
Scott Gray ce96f755ac Add a range condition to EntityDateFilterCondition, useful for finding entities applicable to a given date range.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981008 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 05:31:17 +00:00
Adam Heath 629877dbe2 Generify JdbcValueHandler.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@980643 13f79535-47bb-0310-9956-ffa450edef68
2010-07-30 03:28:15 +00:00
Adam Heath a9ac2afbdb In checkRhs, add support for the rhs being an EntityFieldValue(this is a
partial fix, rhs can actually be *any* EntityConditionValue, so this
logic really needs to be revisited).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@980642 13f79535-47bb-0310-9956-ffa450edef68
2010-07-30 03:28:09 +00:00
Adam Heath 9822ff4f05 Fix checkRhs logic when comparing the value type to the field type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@980641 13f79535-47bb-0310-9956-ffa450edef68
2010-07-30 03:28:04 +00:00
Adrian Crum cc9e403254 Fixed a bug in JdbcValueHandler.java reported by Hans on the dev ml - PostgreSQL BYTEA SQL types threw an exception. This fix replaces the entityengine.xml datasource use-binary-type-for-blob attribute introduced in rev 431161. In other words, the use-binary-type-for-blob attribute is no longer needed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@960929 13f79535-47bb-0310-9956-ffa450edef68
2010-07-06 16:08:51 +00:00
Adrian Crum c255f48060 A little bit of work on the entity condition stuff - no functional change. Improved JavaDocs, eliminated compiler warnings.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@960154 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03 04:27:20 +00:00
Adrian Crum d55b7b2e5c Small JavaDoc improvement, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959889 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02 07:33:30 +00:00
Adrian Crum 850e4a50f1 Small enhancement to JdbcValueHandler: add support for sub-second Timestamp precision on databases that don't support it.
If a user chooses to do so, they can assign the date-time field type to a CHAR(30) SQL type. This will enable sub-second Timestamp precision on databases that don't support it.

The Timestamp will be stored as a string in JDBC Timestamp format (yyyy-mm-dd hh:mm:ss.fffffffff). Date/time comparisons can still be performed in SQL statements, but any date/time functions performed on the field will fail. Users could create UDFs to mimic those functions.

In addition, the CHAR(30) field will consume more storage space than a native Timestamp field (usually 8 bytes).

It will be up to the user to decide if they want to use this feature. If used in a pure OFBiz environment, everything should work as expected.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959868 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02 06:28:14 +00:00
Adrian Crum b49bae579b Removed validators from ModelFieldType.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959716 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 16:38:24 +00:00
Adrian Crum e4b686c9dc Removed validate element from fieldtype*.xml files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959708 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 16:11:10 +00:00
Adrian Crum 3dd7ca4f70 Removed Cloudscape support from the entity engine. Cloudscape has been replaced by Apache Derby.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959695 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 15:28:17 +00:00
Adrian Crum 6ad531be48 Some work on the entity engine:
1. Removed the conversion framework from the entity engine. Type conversions should be done higher up in the stack. The basic pattern is the same, but instead of each ModelFieldType containing a converter instance, it now contains a JdbcValueHandler instance. The JdbcValueHandler performs the same task as the original switch statement - in effect each ModelFieldType contains its own piece of the switch statement.

2. Added two new field types: byte[] and Object. Originally, the Blob field type was a catch-all for multiple Java data types. This change disambiguates the field's contents.

This has been tested on Advantage, Derby, and MySQL. It should be completely backward compatible. I will be monitoring the dev mailing list closely for any problems.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959470 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 23:27:24 +00:00
Adrian Crum 12d7ff5b73 Fixed a bad SQL type in fieldtypemysql.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959457 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:05:58 +00:00
Adrian Crum 76fc2006e5 Entity field test improvements - made them compatible with a broader range of databases.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959456 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:05:04 +00:00
Adrian Crum f7e66e26ba Entity test improvements:
1. Skip foreign key tests on datasources that don't use foreign keys.
2. Test all field types.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@958769 13f79535-47bb-0310-9956-ffa450edef68
2010-06-28 22:29:01 +00:00
Adrian Crum d7a22a1b35 Changed Advantage database setting in entityengine.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@958758 13f79535-47bb-0310-9956-ffa450edef68
2010-06-28 21:54:48 +00:00
Adrian Crum 96fd73e825 Updated fieldtypeadvantage.xml. Some of the SQL types were wrong - causing the tests to fail.
This commit will require anyone using the Advantage database to alter the data types on their existing database - which can be done with the Data Architect.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@958752 13f79535-47bb-0310-9956-ffa450edef68
2010-06-28 21:48:11 +00:00
Adam Heath 13f13a19c5 Another fix for OFBIZ-3789, reported by rohit. COUNT(groupByViewField)
didn't work correctly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@957354 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 21:27:38 +00:00
Erwan de Ferrieres df20c1d880 Adding null condition when using entity-condition in views
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@956565 13f79535-47bb-0310-9956-ffa450edef68
2010-06-21 13:08:30 +00:00
Adam Heath 6eb1758421 Fix pure toString handling of values that contains "'" in them; this was
hacked to work for functions back in 2007, but it was actually broke in
all cases.  Undid the hack, and made it work correctly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@954956 13f79535-47bb-0310-9956-ffa450edef68
2010-06-15 16:40:13 +00:00
Jacques Le Roux 4dbc07a799 A patch from Ankit Jain "Missing "not-in" operator in condtion-expr tag." (https://issues.apache.org/jira/browse/OFBIZ-3819) - OFBIZ-3819
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@953671 13f79535-47bb-0310-9956-ffa450edef68
2010-06-11 11:44:34 +00:00
Adam Heath fbd798ed61 Fix incorrect order by output in sql generation, which fixes OFBIZ-3789;
namely, there was incorrect sql generated when doing a product keyword
search.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@951553 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 20:18:37 +00:00
Jacques Le Roux f65c6e12bf A patch from Bob Morley "Support for order by nulls first/last " (https://issues.apache.org/jira/browse/OFBIZ-3740) - OFBIZ-3740
This patch provides the fundamentals to resolve an issue where the sorting of null values were inconsistent (sometimes sorting first and other times sorting last). Specifically, this patch allows one to create an order-by clause via any of the order-by elements of "-myField NULLS LAST" where this text parses out the - (as descending) and the "nulls last".

Since not all databases support the "nulls" argument on an order by clause (it was introduced as part of the OLAP support specification) , our entity-engine.xml file allows each data source to indicate if it has this support. If the support does not exist and nulls first/last is specified, the sql that is generated uses native sql to simulate the nulls first/last intent. At this time, the derby, postgres, and oracle databases are marked to use the nulls first grammar.

Right now, if you do not specify "NULLS XXX" in the field-name for the order-by it makes no change whatsever (naturally this assumption could be changed to have a default).

It should be noted, that my intent here was ultimately to "properly" model the order by into something whose xml representation could look something like ...
<entity-order-by field-name="fieldName" ascending="true" nulls-first="true" />

Divesh Dutta added a comment - 07/May/10 01:44 AM HI Bob, This patch works as expected for derby, postgres, and oracle databases as you have already mentioned. Cant we have some generic solution which supports all the databases. Or we can have some conditional code, where we can check which datasource is being used, and then generate the sql accordingly. Please let me know your views on this.

Bob Morley added a comment - 07/May/10 08:07 AM
Hi Divesh,
I added a more detailed description in the forum thread; but in brief this is a generic solution which supports all databases which generates the sql accordingly. What this patch does not do is apply a standard default order for all databases; it just adds support for one to dictate how they want the nulls sorted.
For example, when one sets the order-by they can set it to "lastName DESC NULLS FIRST" which should apply to all databases.


The thread Bob was referring above ends at http://markmail.org/message/47z7fwtawehuem6b


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950901 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03 07:39:19 +00:00
Adam Heath 9bf10fa9b4 Use the new isEmpty support in conditions to skip
EntityConditionListBase entries that have no children.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950767 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02 21:24:19 +00:00
Adam Heath fd213c9a3c EntityCondition.isEmpty() support.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950766 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02 21:24:14 +00:00
Adam Heath e8d8b4f777 Refactor the 2 arg version of the addSqlValue method, to use the List
version.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950765 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02 21:24:07 +00:00
Adam Heath 0f6803cde9 Re-apply 949617, add new variants of makeConditionWhereString that take
a StringBuilder, and deprecate the old versions that don't.

This works now because of the previous commit.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950339 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02 02:18:19 +00:00
Adam Heath 8e173bf9c5 Refactor makeConditionWhereString to use the entity condition system to
build the where string.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950338 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02 02:18:14 +00:00
Adam Heath 7c326c1d61 Revert wrongly committed 950255
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950280 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 22:01:23 +00:00
Adam Heath 6c2124c44f Revert wrongly committed 950256
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950279 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 22:01:05 +00:00
Adam Heath 93adfe2429 Start making use of DependencyPool.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950256 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 21:46:32 +00:00
Adam Heath 85138b6244 Multi-threaded creation of tables, foreign key indices, and declared
indices.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950255 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 21:46:24 +00:00
Jacques Le Roux 6ff1d49d7a Revert r949617 because it introduce a bug:
2010-06-01 22:11:30,656 (http-0.0.0.0-8443-5) [  ServiceDispatcher.java:543:ERROR] Error in Service [executeFind]: Error running Find on the [ProductSearchNoNotInUse] entity: SQL Exception while executing the
 following:SELECT DISTINCT PR.PRODUCT_ID, PR.PRODUCT_TYPE_ID, PR.PRIMARY_PRODUCT_CATEGORY_ID, PR.PRODUCT_NAME FROM public.PRODUCT PR LEFT OUTER JOIN public.SUPPLIER_PRODUCT SP ON PR.PRODUCT_ID = SP.PRODUCT_ID
 WHERE  AND ((PR.PRODUCT_TYPE_ID <> ? OR PR.PRODUCT_TYPE_ID IS NULL)) ORDER BY PR.PRODUCT_NAME ASC (ERREUR: erreur de syntaxe sur ou prÞs de ½ AND +
  Position: 206)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950237 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 20:24:03 +00:00
Adam Heath e73898b75b Return the value of needsUpperCase from getIndexInfo, so that the proper case can be used on declared index names.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949628 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:59 +00:00
Adam Heath b7434ab448 When fetching index info, if needsUpperCase is set, then the incoming tableName has been upper-cased. This means we have to convert it *back* to lower case when querying indices against the database.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949627 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:54 +00:00
Adam Heath a99d5b7b94 Add comment that describes why there is a check of the index name existing in set.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949626 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:48 +00:00