Commit Graph
627 Commits
Author SHA1 Message Date
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
Adam Heath a60aabe718 Check whether any indices were created before printing a message saying what was done; handles the case when none were created.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949625 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:42 +00:00
Adam Heath 4a9f3516e4 Start refactoring fkIndex creation and declared index creation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949624 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:35 +00:00
Adam Heath f4ee31c10d Fix wrong index label on declared indices.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949623 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:29 +00:00
Adam Heath fe18c551ee getIndexInfo was skipping all indices that were unique. This was wrong, as it meant that declared unique indices wouldn't be detected, and a creation would be attempted, which would then fail, saying it already existed.
Since all PRIMARY KEY constraints have a prefix of 'PK_', just skip all
those indices instead of checking the uniqueness.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949622 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:24 +00:00
Adam Heath 98b552082b Fetching an index from the database requires the tableName pattern to *not* have the schemaName on the front. So, remove it when querying, but then add it back when checking if the table is allowed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949621 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:18 +00:00
Adam Heath 83507c3b2e In getIndexInfo, moved the lookupSchemaName calculation outside of the loop, as there is no way it could change at runtime.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949620 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:12 +00:00
Adam Heath c16c805359 Refactored several getConnection() calls; if the caller added an error message, then it got refactored.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949619 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:07 +00:00
Adam Heath 93ec48f7e8 Add new variants of makeHavingWhereString that take a StringBuilder, and deprecate the old versions that don't.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949618 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:08:01 +00:00
Adam Heath ea2ce99f4a Add new variants of makeConditionWhereString that take a StringBuilder, and deprecate the old versions that don't.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949617 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:55 +00:00
Adam Heath 99fdeabe24 Add new variants of makeWhereStringFromFields that take a StringBuilder, and deprecate the old versions that don't.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949616 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:50 +00:00
Adam Heath fac74c24b8 Add new variants of fieldsStringList that take a StringBuilder, and deprecate the old versions that don't.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949615 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:44 +00:00
Adam Heath 216a1a29d7 Add new variants of colNameString that take a StringBuilder, and deprecate the old versions that don't.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949614 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:36 +00:00
Adam Heath 4bb8795838 Optimize groupBy insertion a bit, to keep from having to make a copy of the groupBy list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949612 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:29 +00:00
Adam Heath 7e31d0b8e3 Fix instances of String+String while appending to a StringBuilder/StringBuffer.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949611 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:23 +00:00
Adam Heath c8a6d783aa Remove double assignment to addParens(slight optimization/code refactor).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949610 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:07:16 +00:00
Adam Heath ddb9bf8b27 Remove FieldDefFieldValue, and merge FieldDefValue into FieldDef.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949603 13f79535-47bb-0310-9956-ffa450edef68
2010-05-30 22:06:31 +00:00
Jacques Le Roux 6193dd4e53 <author>None</author> is totally useless and we don't need an author OOTB
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@949101 13f79535-47bb-0310-9956-ffa450edef68
2010-05-28 05:41:23 +00:00
Jacques Le Roux 63fd94e778 Not sure why, but my regexp S/R in the commit r948846 boke some formatting. I also removed some useless other stuff in this commit
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948852 13f79535-47bb-0310-9956-ffa450edef68
2010-05-27 14:45:59 +00:00
Jacques Le Roux 2a1a5aee14 We don't need
<copyright>Copyright 2001-.* The Apache Software Foundation</copyright>
<copyright><year>.*</year><holder>Apache Foundation</holder></copyright>
<copyright><year>.*</year><holder>Apache Foundation.</holder></copyright>
<owner>Copyright 2001-.* The Apache Software Foundation</owner>

Less to update every year!

Thanks to BJ 1st effort at "update files from 2009 to 2010" (https://issues.apache.org/jira/browse/OFBIZ-3783) - OFBIZ-3783

Note: there are been a lot of efforts in 2009: there are plenty of data dated from this year!

I hope I did not broke anything (should not, but of course I did not try all changes...) Anyway, this can be easily reverted...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948846 13f79535-47bb-0310-9956-ffa450edef68
2010-05-27 14:23:22 +00:00
Adam Heath 39faca3863 Allow for dynamic registering of additional operators for extensions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948448 13f79535-47bb-0310-9956-ffa450edef68
2010-05-26 14:23:03 +00:00