Commit Graph
1091 Commits
Author SHA1 Message Date
Jacques Le Roux 4330fcd646 Following changes for "PortalPage entity definition wrong. ownerUserLoginId field must be id-vlong-ne" https://issues.apache.org/jira/browse/OFBIZ-5110
Fixes other cases as well

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1639863 13f79535-47bb-0310-9956-ffa450edef68
2014-11-15 12:14:37 +00:00
Jacopo Cappellato 35a4d4f4a8 Improved unit test that was failing when executed in certain platforms.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1639373 13f79535-47bb-0310-9956-ffa450edef68
2014-11-13 15:39:54 +00:00
Adrian Crum 5f5f4fe087 Comment out recently added entity test because it is still having problems. I will look into this more later.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1637063 13f79535-47bb-0310-9956-ffa450edef68
2014-11-06 10:07:32 +00:00
Scott Gray 63f5adf671 Fix bug in EntityQuery where the moment specified in filterByDate(moment) was not being honoured. Adds a new method filterByDate(Timestamp, String...) to allow a moment to be specified when explicitly specifying filterByFieldNames. Thanks to Pritam Kute for the report
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636970 13f79535-47bb-0310-9956-ffa450edef68
2014-11-05 21:43:39 +00:00
Adrian Crum 3e987a2402 Try to fix intermittent entity test failures.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636896 13f79535-47bb-0310-9956-ffa450edef68
2014-11-05 15:30:47 +00:00
Jacopo Cappellato 3552f65800 Merged json-integration-refactoring into trunk:
* moved the json-lib jar (json-lib-2.2.3-jdk15.jar) from the framework/webapp to the framework/base component
* removed the SQL select Parser.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code
* removed the JSON.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code apart from the JSON Converters (now migrated to json-lib, see next items in this list) some utility methods in UtilIO.java (that have been removed too because they have never been used in OFBiz) 
* removed the JavaCC jar and related ant scripts because no more needed after the removal of Parser.jj and JSON.jj
* converted the JSONConverter code that was based on JSON.jj to Jackson
* added a new class org.ofbiz.base.lang.JSON that have been contributed by Adrian Crum that is a facade for simplifying the client code and for hiding the specific JSON library being used
* removed an unused method: ImageManagementServices.toJsonObject(...)
* added TestBooleanConverters to the list of tests
* new unit tests for the new JSON converters
* refactored Ajax code in applications to use the common request json response rather than a custom method
* OFBIZ-5790 Implemented ability to call a service event by passing its input parameters in the request body as JSON data. These classes provide a simple mechanism, based on the request's content type, that can be extended to support other formats (e.g. XML).

This commit resolves OFBIZ-4572, OFBIZ-3365, OFBIZ-5751, OFBIZ-5790



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635901 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 09:06:42 +00:00
Ashish Vijaywargiya e6600ee704 Applied patch from jira issue - OFBIZ-5842.
============================================
As we have Entity Query Builder implemented in trunk (OFBIZ-4053) and now we should add Junit tests for its methods.

As per initial analyses, we can write Junit tests for following methods of Entity Query Builder:

1. queryList()
2. queryFirst()
3. queryCount()
4. queryOne()
5. distinct()
6. filterByDate()
7. orderBy()
8. select()
9. cursorForwardOnly()
10. cursorScrollSensitive()
11. cursorScrollInSensitive()
12. fetchSize()
13. maxRows()
14. cache()
15. queryIterator()
=============================================
Thanks Arun for the contribution. 
Thanks Scott, Jacopo and Adrian for your help in reviewing the patch content. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635894 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 05:59:31 +00:00
Scott Gray 44e2c4fda1 Regex search/replace for delegator.findOne() to EntityQuery.queryOne()
Apologies for the large commit.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635383 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 04:18:05 +00:00
Scott Gray 306bfa48e6 Add filterByDate(Date) method
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1634039 13f79535-47bb-0310-9956-ffa450edef68
2014-10-24 09:56:43 +00:00
Scott Gray 96cd99914e Remove unnecessary imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1634027 13f79535-47bb-0310-9956-ffa450edef68
2014-10-24 08:28:47 +00:00
Scott Gray c638cf936b Fix NPE when filtering by date without having specified a where EntityCondition. Thanks to Arun Patidar for the report.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1633218 13f79535-47bb-0310-9956-ffa450edef68
2014-10-20 20:10:27 +00:00
Scott Gray f01b2ef574 Improve filterByDate(Timestamp) to not filter by date when the passed in Timestamp is null. Better mimics the behavior of EntityUtil.filterByDate(Timestamp)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1631963 13f79535-47bb-0310-9956-ffa450edef68
2014-10-15 07:35:24 +00:00
Scott Gray dec29460dd Parameter name correction
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1630983 13f79535-47bb-0310-9956-ffa450edef68
2014-10-10 20:39:09 +00:00
Scott Gray c4f1e66527 Add where(EntityCondition...) to EntityQuery
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1630978 13f79535-47bb-0310-9956-ffa450edef68
2014-10-10 20:30:13 +00:00
Nicolas Malin 37bb53af64 Add junit test to control entity-auto on create, update and delete to ensure no regression when the entity-auto engine will be improve (like OFBIZ-5800)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1630079 13f79535-47bb-0310-9956-ffa450edef68
2014-10-08 12:17:55 +00:00
Scott Gray 1d03a846a3 Add cache(boolean) method to EntityQuery to allow the cache to be used or not based on a boolean variable. Avoids the need to use an if block when the caching decision isn't hardcoded
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1629782 13f79535-47bb-0310-9956-ffa450edef68
2014-10-06 22:48:40 +00:00
Scott Gray a7d534f589 Add EntityQuery support for filtering by one or more explicit from/thruDate field pairs
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1629538 13f79535-47bb-0310-9956-ffa450edef68
2014-10-05 20:28:25 +00:00
Adrian Crum 1c27aea03e Fixed a bug in GenericDelegator where stack traces were logged when a sequence name didn't match an entity name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1629391 13f79535-47bb-0310-9956-ffa450edef68
2014-10-04 13:30:12 +00:00
Scott Gray fcd7797209 Improved generics for where(List) so that a list of EntityExpr will be accepted. Fixes an issue where the runtime would select the where(Object...) method for a List of EntityExpr objects.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1628287 13f79535-47bb-0310-9956-ffa450edef68
2014-09-29 20:12:04 +00:00
Scott Gray b0dbf709fa OFBIZ-4053 Implement an entity query builder to be used as a friendlier API for executing entity queries.
Entry point is the static EntityQuery.use(Delegator) method which will then return an EntityQuery instance whose methods support method chaining to set query options.
The query can then be executed using the first(), list(), iterator() and one() methods which respectively return:
- The first result from a result set
- The full list of results from a result set
- An EntityListIterator to iterate over a result set
- The single record from a query that will return only one record (such as a lookup by primary key)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627940 13f79535-47bb-0310-9956-ffa450edef68
2014-09-27 09:22:31 +00:00
Jacopo Cappellato 732855faa3 Because of the "negate" attribute the entity-test.jar used to contain all the non-test classes (already in entity.jar).
This fix should be the right way to go but please review this commit because the syntax of these custom ant tasks is rather cryptic to me.
 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627818 13f79535-47bb-0310-9956-ffa450edef68
2014-09-26 15:57:22 +00:00
Jacopo Cappellato 1bf6f051a5 Based on review and comments from Adrian Crum, re-added the max-worker-pool-size element (that was removed as part of the changes in commit 1627092) but with a new implementation that preserves all the cleanups done in rev. 1627092.
This new implementation should be slightly more flexible but with default setup will end up with the same behavior as before 1627092.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627489 13f79535-47bb-0310-9956-ffa450edef68
2014-09-25 08:55:42 +00:00
Jacopo Cappellato adc41ad5bf Moved the thread pool executor object from GenericDAO to the DatabaseUtil class where it was actually used: this change simplifies the API and allows to shutdown the pool when it is no more needed.
Removed a series of methods that are no more needed after this refactoring or were not used.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627092 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 17:04:20 +00:00
Jacopo Cappellato c2b09a6027 Removed an old an unused class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627001 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 13:12:49 +00:00
Jacopo Cappellato f14003d799 Removed a bunch of never used classes from the base/concurrent package.
Provided better settings for the thread pools to avoid to keep alive threads that are only needed at startup.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626977 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 10:52:29 +00:00
Jacopo Cappellato fa8115dba5 Removed the custom CachedClassLoader and related artifacts in favour of a simpler bootstrap process and a simpler classpath tree; now the classpath tree is made of: bootstrap classloader (primordial+ext) -> system classloader (aka applications or classpath classloader) -> two custom classloaders (one loads the framework/base classes and one loads all the other classes) -> Webapp classloaders (one per web application).
Junit tests are included. The two custom classloaders could be merged into one but this will be addressed in a second phase because it will require some changes to the bootstrap componenr and process.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624549 13f79535-47bb-0310-9956-ffa450edef68
2014-09-12 13:49:17 +00:00
Jacopo Cappellato 47651f3e78 Unit test to confirm that running several queries within one transaction is faster than running them wrapped in individual transactions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622171 13f79535-47bb-0310-9956-ffa450edef68
2014-09-03 06:36:33 +00:00
Jacopo Cappellato 6c680d11e9 Improved formatting, comments and variable names.
A failed insert due to duplicated pk will generate an SQLException rather than returning 0 from executeStatement(), so changed the code to reflect this.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622170 13f79535-47bb-0310-9956-ffa450edef68
2014-09-03 06:34:54 +00:00
Jacopo Cappellato e4e0710c18 Removed old and unused experimental class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621810 13f79535-47bb-0310-9956-ffa450edef68
2014-09-01 14:44:19 +00:00
Jacopo Cappellato bde211be6d Small optimization: two strings for sql statements are now stored as final strings in the SequenceBank object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621599 13f79535-47bb-0310-9956-ffa450edef68
2014-08-31 15:41:52 +00:00
Jacques Le Roux eb44087cd8 Upgrades Derby from derby-10.10.2.0.jar to derby-10.11.1.1.jar, tests OK (4 not relevant failures on Windows, we will get confirmation with Buildbot, or revert)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621581 13f79535-47bb-0310-9956-ffa450edef68
2014-08-31 10:18:38 +00:00
Adrian Crum fe096a298c Fixing some GenericDelegator method signatures to match the Delegator interface.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621460 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 13:38:24 +00:00
Adrian Crum f3e657b4d8 Move some GenericDelegator static methods to the Delegator interface.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621448 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 12:01:45 +00:00
Adrian Crum 0a76309879 Removed unnecessary public keywords from the Delegator interface.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621445 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 11:22:46 +00:00
Adrian Crum f14616dbdb Small code cleanup - use auto-boxing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621442 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 09:53:25 +00:00
Adrian Crum 4e38c83fbc Removed references to GenericDelegator from Delegator interface.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621439 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 09:19:38 +00:00
Jacopo Cappellato 892ed70e57 Completely refactored the SequenceUtil class:
* the class is now thread safe
* the class is now cleaner (no references to delegator etc...)
* replaced the collision detection algorithm with a simpler/reliable/efficient one based on: update with no changes (to get a lock) + select + update (to increase the last sequence id)
* removed ugly special code for "clusters" that is no more needed



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621438 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 09:17:07 +00:00
Adrian Crum f4f119d057 Removed a deprecated constructor from GenericDelegator.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621437 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 09:12:00 +00:00
Adrian Crum 00d61094d0 Removed some references to GenericDelegator concrete class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621436 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 09:00:39 +00:00
Jacopo Cappellato e5018c0031 Misc minor enhancements to the testSequenceValueItemWithConcurrentThreads unit test.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621425 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 08:32:14 +00:00
Adrian Crum 724ec8bb49 Fixed bugs in GenericDelegator.java - storeByCondition and removeByCondition did not update the cache, resulting in stale cache entries.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621413 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 02:49:22 +00:00
Adrian Crum 1810b389c7 Fix unintended change in my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621386 13f79535-47bb-0310-9956-ffa450edef68
2014-08-29 20:58:25 +00:00
Adrian Crum b4db076bb4 Unit test to demonstrate the bug I found in GenericDelegator.java. Test is commented out.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621385 13f79535-47bb-0310-9956-ffa450edef68
2014-08-29 20:56:08 +00:00
Jacopo Cappellato 38f5c17d0d Fixed an issue affecting the thread safeness of the SequenceBank objects.
Added two unit tests to confirm the proper behavior of the SequenceUtil class; the second test fails without the fix committed with this revision.
Part of OFBIZ-2353.
This is just the first pass of my work to refactor the SequenceUtil.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621335 13f79535-47bb-0310-9956-ffa450edef68
2014-08-29 16:26:51 +00:00
Adrian Crum 9156158d93 Found a bug in GenericDelegator.java. No time to fix it now, so leaving a FIXME comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621122 13f79535-47bb-0310-9956-ffa450edef68
2014-08-28 11:36:39 +00:00
Jacopo Cappellato c00fc92699 Merged framework-api-cleanup branch into trunk.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1620538 13f79535-47bb-0310-9956-ffa450edef68
2014-08-26 09:16:52 +00:00
Adrian Crum c63cb8c89e Better encapsulation of entity engine multitenant setting.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1620120 13f79535-47bb-0310-9956-ffa450edef68
2014-08-24 10:27:24 +00:00
Jacopo Cappellato 10aceb0cfe Trivial fix to a log statement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1619799 13f79535-47bb-0310-9956-ffa450edef68
2014-08-22 13:12:51 +00:00
Jacopo Cappellato 52d0dc1568 Upgraded Derby (embedded dbms) to the latest bug fix release 10.10.2.0
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1619319 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 09:16:40 +00:00
Adrian Crum 3fbbbd685a Remove console warnings related to method deprecation, https://issues.apache.org/jira/browse/OFBIZ-5718.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1618459 13f79535-47bb-0310-9956-ffa450edef68
2014-08-17 06:05:50 +00:00