mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-14149 Improve efficiency of LazyAttributesMetadata#getLazyAttributeNames
This commit is contained in:
parent
fb6bb820f1
commit
fe3f27a733
@ -26,6 +26,7 @@
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class LazyAttributesMetadata implements Serializable {
|
||||
|
||||
/**
|
||||
* Build a LazyFetchGroupMetadata based on the attributes defined for the
|
||||
* PersistentClass
|
||||
@ -83,6 +84,8 @@ public static LazyAttributesMetadata nonEnhanced(String entityName) {
|
||||
|
||||
private final Map<String, LazyAttributeDescriptor> lazyAttributeDescriptorMap;
|
||||
private final Map<String,Set<String>> fetchGroupToAttributeMap;
|
||||
private final Set<String> fetchGroupNames;
|
||||
private final Set<String> lazyAttributeNames;
|
||||
|
||||
public LazyAttributesMetadata(String entityName) {
|
||||
this( entityName, Collections.emptyMap(), Collections.emptyMap() );
|
||||
@ -95,6 +98,8 @@ public LazyAttributesMetadata(
|
||||
this.entityName = entityName;
|
||||
this.lazyAttributeDescriptorMap = lazyAttributeDescriptorMap;
|
||||
this.fetchGroupToAttributeMap = fetchGroupToAttributeMap;
|
||||
this.fetchGroupNames = Collections.unmodifiableSet( fetchGroupToAttributeMap.keySet() );
|
||||
this.lazyAttributeNames = Collections.unmodifiableSet( lazyAttributeDescriptorMap.keySet() );
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
@ -110,11 +115,14 @@ public int lazyAttributeCount() {
|
||||
}
|
||||
|
||||
public Set<String> getLazyAttributeNames() {
|
||||
return lazyAttributeDescriptorMap.keySet();
|
||||
return lazyAttributeNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an immutable set
|
||||
*/
|
||||
public Set<String> getFetchGroupNames() {
|
||||
return fetchGroupToAttributeMap.keySet();
|
||||
return fetchGroupNames;
|
||||
}
|
||||
|
||||
public boolean isLazyAttribute(String attributeName) {
|
||||
@ -137,6 +145,10 @@ public List<LazyAttributeDescriptor> getFetchGroupAttributeDescriptors(String gr
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This method is not being used and as such will be removed
|
||||
*/
|
||||
@Deprecated
|
||||
public Set<String> getAttributesInSameFetchGroup(String attributeName) {
|
||||
final String fetchGroupName = getFetchGroupName( attributeName );
|
||||
return getAttributesInFetchGroup( fetchGroupName );
|
||||
|
Loading…
x
Reference in New Issue
Block a user