blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

Unclear error mesage

Open roma2341 opened this issue 2 months ago • 1 comments

I had @EntityView View1 with a lot of properties. Then i need to add View2 and reuse some properties from View1, so i moved them to BasicView interface so View1 and View2 extends this BasicView. But now queries that worked with View1 didn't work throwing exception that says nothing.

This BasicView extends another entity view:

@EntityView(MyEntity.class) @EntityViewInheritance() public interface CoreView

java.lang.NullPointerException: Cannot invoke "com.blazebit.persistence.SubqueryInitiator.from(String, String)" because the return value of "com.blazebit.persistence.SelectBuilder.selectSubquery(String, String)" is null
	at com.blazebit.persistence.view.impl.objectbuilder.mapper.MultisetTupleElementMapper.applyMapping(MultisetTupleElementMapper.java:62) ~[blaze-persistence-entity-view-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.view.impl.objectbuilder.mapper.ConstrainedTupleElementMapper.applyMapping(ConstrainedTupleElementMapper.java:94) ~[blaze-persistence-entity-view-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.view.impl.objectbuilder.ViewTypeObjectBuilder.applySelects(ViewTypeObjectBuilder.java:98) ~[blaze-persistence-entity-view-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.view.impl.objectbuilder.DelegatingObjectBuilder.applySelects(DelegatingObjectBuilder.java:39) ~[blaze-persistence-entity-view-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.view.impl.objectbuilder.ChainingObjectBuilder.applySelects(ChainingObjectBuilder.java:46) ~[blaze-persistence-entity-view-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.impl.SelectManager.selectNew(SelectManager.java:629) ~[blaze-persistence-core-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.impl.AbstractFullQueryBuilder.selectNew(AbstractFullQueryBuilder.java:1018) ~[blaze-persistence-core-impl-jakarta-1.6.11.jar:1.6.11]
	at com.blazebit.persistence.impl.CriteriaBuilderImpl.selectNew(CriteriaBuilderImpl.java:118) ~[blaze-persistence-core-impl-jakarta-1.6.11.jar:1.6.11]

Tries both: <artifactId>blaze-persistence-bom</artifactId> 1.6.11

And 1.6.17

I think i made some error in mapping when moving out properties to common interface, but i think that error could be more helpful.

In my case issue happened because i extended my class in child EntityView instead of parent EntityView.

roma2341 avatar Oct 20 '25 16:10 roma2341

Hi and thanks for reporting this issue. Can you please share the code of the entity views that reproduces this issue?

beikov avatar Oct 21 '25 07:10 beikov