@SuppressWarnings("unchecked") private <T extends J> ManagedTypeDescriptor<T> valueGraphTypeAsManaged() { final SimpleTypeDescriptor<J> valueGraphType = (SimpleTypeDescriptor) getAttributeDescriptor().getValueGraphType(); if ( valueGraphType instanceof ManagedTypeDescriptor ) { return (ManagedTypeDescriptor) valueGraphType; } throw new CannotContainSubGraphException( String.format( Locale.ROOT, "Attribute [%s] (%s) cannot contain value sub-graphs", getAttributeName(), getAttributeDescriptor().getPersistentAttributeType().name() ) ); }
@SuppressWarnings("unchecked") private <T extends J> ManagedTypeDescriptor<T> keyGraphTypeAsManaged() { final SimpleTypeDescriptor<J> keyGraphType = (SimpleTypeDescriptor) getAttributeDescriptor().getKeyGraphType(); if ( keyGraphType instanceof ManagedTypeDescriptor ) { return (ManagedTypeDescriptor) keyGraphType; } throw new CannotContainSubGraphException( String.format( Locale.ROOT, "Attribute [%s#%s] (%s) cannot contain key sub-graphs - %s", getAttributeDescriptor().getDeclaringType().getName(), getAttributeName(), getAttributeDescriptor().getPersistentAttributeType().name(), keyGraphType ) ); }
attributeType.name());
default: throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_ATTRIBUTE_TYPE, attributeType.name());
@SuppressWarnings("unchecked") private <T extends J> ManagedTypeDescriptor<T> keyGraphTypeAsManaged() { final SimpleTypeDescriptor<J> keyGraphType = (SimpleTypeDescriptor) getAttributeDescriptor().getKeyGraphType(); if ( keyGraphType instanceof ManagedTypeDescriptor ) { return (ManagedTypeDescriptor) keyGraphType; } throw new CannotContainSubGraphException( String.format( Locale.ROOT, "Attribute [%s#%s] (%s) cannot contain key sub-graphs - %s", getAttributeDescriptor().getDeclaringType().getDomainTypeName(), getAttributeName(), getAttributeDescriptor().getPersistentAttributeType().name(), keyGraphType ) ); }
@SuppressWarnings("unchecked") private <T extends J> ManagedTypeDescriptor<T> valueGraphTypeAsManaged() { final SimpleTypeDescriptor<J> valueGraphType = (SimpleTypeDescriptor) getAttributeDescriptor().getValueGraphType(); if ( valueGraphType instanceof ManagedTypeDescriptor ) { return (ManagedTypeDescriptor) valueGraphType; } throw new CannotContainSubGraphException( String.format( Locale.ROOT, "Attribute [%s] (%s) cannot contain value sub-graphs", getAttributeName(), getAttributeDescriptor().getPersistentAttributeType().name() ) ); }