The createEntittyAuditLogSingle function creates a record in the AuditLog entity even when there's no change. This patch only logs new, changed and deleted values. Also, all changes in the same transaction will get the same change date.
After applying this patch the overhead of the AuditEntityLog is recuded from 32% to 25%.
There's even more room for performance increase: a findOne search for the previous entity is done for every field that's enabled.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1056973 13f79535-47bb-0310-9956-ffa450edef68
When "table name" is required to a "model entity" object, it throws a NPE if "datasource info" object is null.
JLR: I'm not quite sure in which occasions this fix is needed OOTB, but anyway it's safer indeed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1040890 13f79535-47bb-0310-9956-ffa450edef68
normalized. This fixes oracle at startup, so that it doesn't wrongly
thing that no tables are defined in the database.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1005628 13f79535-47bb-0310-9956-ffa450edef68
passing any of the values thru the prepared statement; this meant that
toString() was being called, instead of the correct setFoo method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1005624 13f79535-47bb-0310-9956-ffa450edef68
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
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
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