Commit Graph
952 Commits
Author SHA1 Message Date
Adrian Crum f315f0d5be Fix warnings in trunk in Java source code - https://issues.apache.org/jira/browse/OFBIZ-6217.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1669537 13f79535-47bb-0310-9956-ffa450edef68
2015-03-27 10:04:14 +00:00
Adrian Crum 0f2db40ee3 Initial commit of the fix for the dirty cache reads problem - https://issues.apache.org/jira/browse/OFBIZ-5534.
This fixes the PK cache only, the other caches will be fixed after this commit is reviewed.

I didn't include a unit test because Derby deadlocks while testing for this. Actually, the deadlock proves the problem is fixed. I will continue trying to find a way to provide a unit test.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668267 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 13:44:55 +00:00
Adrian Crum 755ee6ae6f Oops, I forgot to include unit tests in my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668261 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 12:51:34 +00:00
Adrian Crum f20303d0e3 Some work on GenericEntity and its subclasses: Enforce GenericPK != GenericEntity and GenericValue != GenericEntity.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668257 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 12:36:44 +00:00
Adrian Crum 6dd1483da2 Some small optimizations in the entity engine - don't repeatedly build things that don't change over time.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1668232 13f79535-47bb-0310-9956-ffa450edef68
2015-03-21 10:47:49 +00:00
Scott Gray 270542d98a Fix bug in EntityQuery where performing queryFirst() while using cache and filtering by date would return invalid results due to the database result being prematurely limited by setMaxRows(1). The full result is needed before we can properly perform in memory date filtering. Thanks to Deepak Dixit for the bug report
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1665311 13f79535-47bb-0310-9956-ffa450edef68
2015-03-09 17:34:42 +00:00
Jacopo Cappellato f232ce4446 Fix for bug causing an error trace when a query was executed (with cache on) using conditions created using EntityConditionBuilder:
java.lang.UnsupportedOperationException: hashCode: org.ofbiz.entity.condition.EntityConditionBuilder$ConditionHolder
     [java] java.lang.UnsupportedOperationException: hashCode: org.ofbiz.entity.condition.EntityConditionBuilder$ConditionHolder

Thanks to Deepak Dixit for the bug report and for his tests.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1665154 13f79535-47bb-0310-9956-ffa450edef68
2015-03-09 08:34:30 +00:00
Ashish Vijaywargiya 835a77bfa8 Applied patch from jira issue - OFBIZ-4977 - Limitation and issue with delegator.findByPrimaryKeyPartial method : returns error when partialKeyset contains PK value.
Thanks Sumit for creating the issue and providing the patch for the same. Thanks Arun for the verification. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1661292 13f79535-47bb-0310-9956-ffa450edef68
2015-02-21 06:59:57 +00:00
Jacopo Cappellato 29afa23882 OFBIZ-6071: fix for issue in decrypting entity fields (encrypt="true" in entity definition) in tenant mode. Thanks to Divesh Dutta and Rohit Koushal for the report, the fix and the tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1660579 13f79535-47bb-0310-9956-ffa450edef68
2015-02-18 09:02:15 +00:00
Adrian Crum 99763dffaf Fix C&P error in my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1658214 13f79535-47bb-0310-9956-ffa450edef68
2015-02-08 16:59:09 +00:00
Adrian Crum 480a28508d Add SQL 2003 and JDBC 4 support to JdbcValueHandler.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1658211 13f79535-47bb-0310-9956-ffa450edef68
2015-02-08 16:56:26 +00:00
Adrian Crum 1a595f70ab Fixed a NPE bug in ModelViewEntity, reported by Christian Carlow on the user mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1655795 13f79535-47bb-0310-9956-ffa450edef68
2015-01-29 18:47:29 +00:00
Jacopo Cappellato b5d24765cf Modified code to make sure the EntityListIterator is always closed after being used.
Thanks to Deepak Dixit and Nameet Jain for spotting the issue and identifying the offending code.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1652361 13f79535-47bb-0310-9956-ffa450edef68
2015-01-16 08:34:49 +00:00
Adrian Crum 14e3b15252 Some small fixups for some of my previous commits.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1650347 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 17:53:59 +00:00
Adrian Crum 9d83f49c45 New Feature: EntityClassLoader. This should be a better solution than the current EntityProperties implementation. Includes example usage in ControlServlet.java (commented out for now).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649620 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 19:22:56 +00:00
Adrian Crum 0f18840dd3 Fixed a bug in the entity engine that prevented data loading into a byte-array field type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649614 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 19:06:41 +00:00
Jacques Le Roux b567828392 A patch from Anahita Goljahani for "EntityListIterator closing issue with EntityQuery.queryCount() when using DinamicViewEntity" https://issues.apache.org/jira/browse/OFBIZ-5921
When using the queryCount() method of EntityQuery with a DinamicViewEntity, I get an error message about the EntityListIterator not being closed.

This properly closes the EntityListIterator

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647275 13f79535-47bb-0310-9956-ffa450edef68
2014-12-22 10:01:53 +00:00
Jacopo Cappellato 21dda83a53 Fixed a few unit tests that were failing due to recent updates for EntityQuery calls.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646787 13f79535-47bb-0310-9956-ffa450edef68
2014-12-19 16:13:08 +00:00
Jacopo Cappellato f9d619b103 OFBIZ-5004: an IllegalArgumentException is thrown if an attempt to select an invalid field is performed; the code was just logging a warning message. Thanks to Christoph Neuroth, Adrian Crum, Paul Foxworthy, Scott Gray, Jacques Le Roux, Adam Heath for their valuable feedback and comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646666 13f79535-47bb-0310-9956-ffa450edef68
2014-12-19 10:54:13 +00:00
Ashish Vijaywargiya 80687f8fc2 Minor fix that got missed in 1646212.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646433 13f79535-47bb-0310-9956-ffa450edef68
2014-12-18 10:34:14 +00:00
Ashish Vijaywargiya 039f0608bc Applied framework related patch from jira issue - OFBIZ-5844 - Convert java files to EntityQuery.
Thanks Arun for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646212 13f79535-47bb-0310-9956-ffa450edef68
2014-12-17 12:13:46 +00:00
Ashish Vijaywargiya f19b8bdfe7 Reverting r1646165. It seems that changes that we did for <property-to-field> are not needed. I will commit the new changes soon.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646191 13f79535-47bb-0310-9956-ffa450edef68
2014-12-17 10:49:41 +00:00
Ashish Vijaywargiya fa7cb8eb15 Applied recent patch from jira issue - OFBIZ-5902 - Fetch configurable settings data driven by replacing UtilProperties.getPropertyValue() method with EntityUtilProperties.getPropertyValue().
Thanks Arun for the contribution. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646165 13f79535-47bb-0310-9956-ffa450edef68
2014-12-17 07:57:56 +00:00
Jacopo Cappellato ee209c08f6 Moved to the Attic the framework/sql component.
The framework/sql was an attempt to create a specialized SQL parser for the OFBiz entity engine. The idea was to use a standardized SQL string that the parser would convert to entity conditions and Delegator calls. So, you could use the same SQL string on any database. The component was never finished.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644469 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 16:24:48 +00:00
Jacopo Cappellato afbf52ff23 Converted from warning to info two startup messages informing about the mechanism used to retrieve pk information from the database.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644354 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 09:11:47 +00:00
Jacopo Cappellato 79dd228162 OFBIZ-5146: added support for three new ModelViewEntity functions for the extraction of year, month, day from a date field: extract-year, extract-month, extract-day.
They are mapped to the Standard SQL:2011 EXTRACT function that is already supported by several DBMS including PostgreSQL and MySQL (but not yet Derby).



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644348 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 08:25:45 +00:00
Jacopo Cappellato 6cb3300f90 Added a check to prevent client code holding a reference to a "tenant" delegator to access super/meta tenant tables. Thanks to Arun Patidar for spotting this and for discussing with me the proper solution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1643499 13f79535-47bb-0310-9956-ffa450edef68
2014-12-06 08:01:06 +00:00
Jacques Le Roux d6c2d35d34 Inconsistencies related to the "java -jar ofbiz.jar" commands when used with arguments https://issues.apache.org/jira/browse/OFBIZ-5872
The help gives you:
c:\projectsASF\ofbiz>java -jar ofbiz.jar -help

Usage: java -jar ofbiz.jar [command] [arguments]
-both    -----> Run simultaneously the POS (Point of Sales) application and OFBiz standard
-help, -? ----> This screen
-install -----> Run install (create tables/load data)
-pos     -----> Run the POS (Point of Sales) application
-setup -------> Run external application server setup
-start -------> Start the server
-status ------> Status of the server
-shutdown ----> Shutdown the server
-test --------> Run the JUnit test script
[no config] --> Use default config
[no command] -> Start the server w/ default config

But actually only the -help, -status and -shutdown command need a dash. 

For now we decided to change the documentation generated by the help command to remove dashes when they are not needed.

To change 
-install -----> Run install (create tables/load data)
by
-load-data -----> Create tables/load data

To comment out the 
-setup -------> Run external application server setup
line

When done, we will try to have things consistent and re-add the missing dashes to the commands and in the help. Then the "Technical production setup guide" should be updated, pfew...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1640588 13f79535-47bb-0310-9956-ffa450edef68
2014-11-19 16:27:49 +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
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 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