File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/kotlin/team/yi/rsql/querydsl Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -285,10 +285,14 @@ class QuerydslRsql<E> private constructor(builder: Builder<E>) {
285285
286286 requireNotNull(rsqlConfig.entityManager) { " Entity manager cannot be null." }
287287
288- this .entityClass = when (builder.entityClass) {
289- null -> RsqlUtil .getClassForEntityString(builder.entityName!! , rsqlConfig.entityManager) as Class <E >?
290- else -> builder.entityClass
291- } ? : throw EntityNotFoundException (" Can't find entity with name: " + builder.entityName, builder.entityName)
288+ val entityClass = builder.entityClass
289+ val entityName = builder.entityName
290+
291+ this .entityClass = when {
292+ entityClass != null -> entityClass
293+ entityName != null -> RsqlUtil .getClassForEntityString(entityName, rsqlConfig.entityManager) as Class <E >?
294+ else -> null
295+ } ? : throw EntityNotFoundException (" Can't find entity with name: $entityName " , entityName)
292296
293297 this .select = builder.select
294298 this .expressionSelect = builder.expressionSelect
You can’t perform that action at this time.
0 commit comments