protected final String getValidJPAColumnName(Class<?> entity, Field f)
    {

        String name = null;

        if (f.isAnnotationPresent(Column.class))
        {
            Column c = f.getAnnotation(Column.class);
            if (!c.name().isEmpty())
            {
                name = c.name();
            }
            else
            {
                name = f.getName();
            }
        }
        else if (f.isAnnotationPresent(Basic.class))
        {
            name = f.getName();
        }

        if (f.isAnnotationPresent(Temporal.class))
        {
            if (!f.getType().equals(Date.class))
            {
                log.error("@Temporal must map to java.util.Date for @Entity(" + entity.getName() + "." + f.getName()
                        + ")");
                return name;
            }
            if (null == name)
            {
                name = f.getName();
            }
        }
        return name;
    }
protected final String getValidJPAColumnName ( Class < ? > entity , Field f ) { String name = null ; if ( f . isAnnotationPresent ( Column . class ) ) { Column c = f . getAnnotation ( Column . class ) ; if ( ! c . name ( ) . isEmpty ( ) ) { name = c . name ( ) ; } else { name = f . getName ( ) ; } } else if ( f . isAnnotationPresent ( Basic . class ) ) { name = f . getName ( ) ; } if ( f . isAnnotationPresent ( Temporal . class ) ) { if ( ! f . getType ( ) . equals ( Date . class ) ) { log . error ( "@Temporal must map to java.util.Date for @Entity(" + entity . getName ( ) + "." + f . getName ( ) + ")" ) ; return name ; } if ( null == name ) { name = f . getName ( ) ; } } return name ; }
Gets the valid jpa column name.

@param entity
the entity
@param f
the f
@return the valid jpa column name