class PrimitiveLongToShortMapper implements TypeMapper<Long, Short> {

    @Override
    public String getLabel() {
        return "Long to short (primitive)";
    }

    @Override
    public Type getJavaType(Column column) {
        return short.class;
    }

    @Override
    public Short toJavaType(Column column, Class<?> entityType, Long value) {
        return value == null ? null : ((short) (long) value);
    }

    @Override
    public Long toDatabaseType(Short value) {<FILL_FUNCTION_BODY>}

    @Override
    public Ordering getOrdering() {
        return Ordering.RETAIN;
    }
    
}

        return value == null ? null : ((long) (short) value);
    
<no_super_class>