Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2016-07-20 16:442016-07-26 09:29
ReporterSanjotaView Statuspublic 
Assigned Toalostale 
PriorityhighResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revisionb7bce66ab192
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0033515: NPE in AdvancedQueryBuilder with joinAssociatedEntities if entity has computed columns

DescriptionAdvancedQueryBuilder has a joinAssociatedEntities which creates the query including joins for all many-to-one properties. If the entity being queried includes computed columns, a NPE is thrown.

Note this does not affect standard behavior, as the default value for joinAssociatedEntities is always null when invoked from UI.
Steps To ReproduceWhenever we use advanced query builder for retrieving records from the table,
if the table has computed column(as property) then property.getTargetEntity() is null and
KernelUtils.hasNullableIdentifierProperties(property.getTargetEntity()) will through null pointer exception.

Example Scenario : Following are steps for one of the scenario faced
1) Install module to pi environment.
2) Test i.e Run as Junit.
3) Test - test20733() present in fails
Giving details of the stack trace for Null pointer exception as
    at org.openbravo.client.kernel.KernelUtils.hasNullableIdentifierProperties(
    at org.openbravo.service.json.AdvancedQueryBuilder$JoinDefinition.getJoinStatement(
    at org.openbravo.service.json.AdvancedQueryBuilder.getJoinClause(
    at org.openbravo.service.json.DataEntityQueryService.getWhereClause(
    at org.openbravo.service.json.DataEntityQueryService.buildOBQuery(
    at org.openbravo.service.json.DataEntityQueryService.list(
    at org.openbravo.test.dal.IssuesTest.test20733(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(
    at org.junit.internal.runners.statements.RunBefores.evaluate(
    at org.junit.internal.runners.statements.RunAfters.evaluate(
    at org.junit.rules.TestWatcher$1.evaluate(
    at org.junit.rules.RunRules.evaluate(
    at org.junit.runners.ParentRunner.runLeaf(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.ParentRunner$
    at org.junit.runners.ParentRunner$1.schedule(
    at org.junit.runners.ParentRunner.runChildren(
    at org.junit.runners.ParentRunner.access$000(
    at org.junit.runners.ParentRunner$2.evaluate(
    at org.junit.internal.runners.statements.RunBefores.evaluate(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
TagsNo tags attached.
Attached Filesdiff file icon 33515.diff [^] (1,463 bytes) 2016-07-20 16:52 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
hgbot (developer)
2016-07-21 09:13

Repository: erp/devel/pi
Changeset: b7bce66ab19202bc3cad0ca6070c6d5d21c6fed8
Author: Asier Lostalé <asier.lostale <at>>
Date: Thu Jul 21 09:12:30 2016 +0200
URL: [^]

fixed 33515: NPE in AQB with associated entities if entity has computed columns

  When AdvancedQueryBuilder was used with the joinAssociatedEntities property set
  to true and the queried entity included computed columns, a NPE was trhown.

  Fixed by treating computed column property as an special case forcing always
  a left join for it.

M modules/org.openbravo.service.json/src/org/openbravo/service/json/
caristu (developer)
2016-07-26 09:29

Code review + testing OK.

Tested using steps to reproduce in pi@c1dff2b0991a

- Issue History
Date Modified Username Field Change
2016-07-20 16:44 Sanjota New Issue
2016-07-20 16:44 Sanjota Assigned To => platform
2016-07-20 16:44 Sanjota Modules => Core
2016-07-20 16:44 Sanjota Triggers an Emergency Pack => No
2016-07-20 16:45 Sanjota Severity major => minor
2016-07-20 16:52 aferraz File Added: 33515.diff
2016-07-21 09:08 alostale Summary Nullpointer exception in KernelUtils.hasNullableIdentifierProperties() present in => NPE in AdvancedQueryBuilder with joinAssociatedEntities if entity has computed columns
2016-07-21 09:08 alostale Description Updated View Revisions
2016-07-21 09:12 alostale Review Assigned To => caristu
2016-07-21 09:12 alostale Assigned To platform => alostale
2016-07-21 09:13 hgbot Checkin
2016-07-21 09:13 hgbot Note Added: 0088607
2016-07-21 09:13 hgbot Status new => resolved
2016-07-21 09:13 hgbot Resolution open => fixed
2016-07-21 09:13 hgbot Fixed in SCM revision => [^]
2016-07-26 09:29 caristu Note Added: 0088657
2016-07-26 09:29 caristu Status resolved => closed
2016-07-26 09:29 caristu Fixed in Version => 3.0PR16Q4

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker