Skip to content

Commit

Permalink
[Bug #285] format code properly
Browse files Browse the repository at this point in the history
  • Loading branch information
luxbe authored and ledsoft committed Nov 22, 2024
1 parent e86a5f9 commit 425a38b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ public <T> Object createProxy(T entity, FieldSpecification<? super T, ?> fieldSp
return new LazyLoadingMapProxy<>(entity, (FieldSpecification) fieldSpec, uow);
} else if (Collection.class.isAssignableFrom(type)) {
CollectionType collectionType;
assert fieldSpec instanceof PluralAttribute<?,?,?> || fieldSpec instanceof PluralQueryAttribute<?,?,?>;
assert fieldSpec instanceof PluralAttribute<?, ?, ?> || fieldSpec instanceof PluralQueryAttribute<?, ?, ?>;

if(fieldSpec instanceof PluralAttribute) {
final PluralAttribute<? super T, ?, ?> pa = (PluralAttribute<? super T, ?, ?>) fieldSpec;
if (fieldSpec instanceof PluralAttribute<? super T, ?, ?> pa) {
collectionType = pa.getCollectionType();
} else {
final PluralQueryAttribute<? super T, ?, ?> pa = (PluralQueryAttribute<? super T, ?, ?>) fieldSpec;
Expand All @@ -77,10 +76,11 @@ public <T> Object createProxy(T entity, FieldSpecification<? super T, ?> fieldSp
case SET, COLLECTION -> new LazyLoadingSetProxy<>(entity, (FieldSpecification) fieldSpec, uow);
default -> throw new IllegalArgumentException("Unsupported collection type for lazy proxying.");
};
}else if (uow.getMetamodel().isEntityType(type)) {
} else if (uow.getMetamodel().isEntityType(type)) {
try {
final Class<?> proxyType = uow.getMetamodel().getLazyLoadingProxy(type);
final LazyLoadingEntityProxy<?> proxy = (LazyLoadingEntityProxy<?>) proxyType.getDeclaredConstructor().newInstance();
final LazyLoadingEntityProxy<?> proxy = (LazyLoadingEntityProxy<?>) proxyType.getDeclaredConstructor()
.newInstance();
proxy.setOwner(entity);
proxy.setPersistenceContext(uow);
proxy.setFieldSpec(fieldSpec);
Expand Down

0 comments on commit 425a38b

Please sign in to comment.