use of com.blazebit.persistence.view.spi.type.VersionBasicUserType in project blaze-persistence by Blazebit.
the class EntityViewUpdaterImpl method createVersionFlusher.
private VersionAttributeFlusher<Object, Object> createVersionFlusher(EntityViewManagerImpl evm, EntityType<?> entityType, AbstractMethodAttribute<?, ?> versionAttribute) {
String attributeName = versionAttribute.getName();
String attributeMapping = versionAttribute.getMapping();
String parameterName = versionAttribute.getName();
String updateFragment = versionAttribute.getMapping();
AttributeAccessor viewAttributeAccessor = Accessors.forViewAttribute(evm, versionAttribute, false);
AttributeAccessor attributeAccessor = Accessors.forEntityMapping(evm, versionAttribute);
Type<?> type = ((com.blazebit.persistence.view.metamodel.SingularAttribute<?, ?>) versionAttribute).getType();
@SuppressWarnings("unchecked") VersionBasicUserType<Object> userType = (VersionBasicUserType<Object>) ((BasicType<?>) type).getUserType();
boolean jpaVersion = entityType.getSingularAttribute(versionAttribute.getMapping()).isVersion();
return new VersionAttributeFlusher<>(attributeName, attributeMapping, userType, updateFragment, parameterName, attributeAccessor, viewAttributeAccessor, jpaVersion);
}
Aggregations