You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been reviewing the code and noticed some areas in JpaMetamodel where small improvements can be made to enhance code readability and maintainability. Here are my suggestions:
In some code, lambda expressions can be replaced with method references, for example:
this.managedTypes = Lazy.of(() -> metamodel.getManagedTypes().stream()
.map(ManagedType::getJavaType)
.filter(it -> it != null) // It can be repalced with lambda expressions
.collect(StreamUtils.toUnmodifiableSet()));
this.jpaEmbeddables = Lazy.of(() -> metamodel.getEmbeddables().stream()
.map(ManagedType::getJavaType)
.filter(it -> it != null) // It can be repalced with lambda expressions
.filter(it -> AnnotatedElementUtils.isAnnotated(it, Embeddable.class))
.collect(StreamUtils.toUnmodifiableSet()));
return metamodel.getEntities().stream()
.filter(it -> entity.equals(it.getJavaType()))
.findFirst()
.flatMap(it -> getSingularIdAttribute(it)) // It can be repalced with lambda expressions
.filter(it -> it.getJavaType().equals(attributeType))
.map(it -> it.getName().equals(name))
.orElse(false);
The text was updated successfully, but these errors were encountered:
I have been reviewing the code and noticed some areas in JpaMetamodel where small improvements can be made to enhance code readability and maintainability. Here are my suggestions:
The text was updated successfully, but these errors were encountered: