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
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
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
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
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
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
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
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
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-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
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