Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.java.ao.schema;
 
 
 import static com.google.common.base.Preconditions.*;

Gets the table name from the Table annotation. If no annotation is present on the given entity then it will delegate to the configured TableNameConverter.

Since:
0.9
public final class TableAnnotationTableNameConverter implements TableNameConverter
    public static final Class<TableTABLE_ANNOTATION = Table.class;
    public TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverter)
    {
        this(delegateTableNameConverternew IdentityTableNameConverter());
    }
    public TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverterCanonicalClassNameTableNameConverter postProcessingTableNameConverter)
    {
        this. = checkNotNull(delegateTableNameConverter);
        this. = checkNotNull(postProcessingTableNameConverter);
    }

    
Gets the name of the table either from the Table annotation if present or from the delegate.

Parameters:
entityClass the entity from which to extract the table name
Returns:
the table name for the given entity
Throws:
java.lang.IllegalStateException if the Table annotation value is invalid (null or empty java.lang.String)
    public String getName(Class<? extends RawEntity<?>> entityClass)
    {
        if (entityClass.isAnnotationPresent())
        {
        }
        else
        {
            return .getName(entityClass);
        }
    }
    private String validate(String value)
    {
        checkState(value != null && !value.equals(""), "Value %s for table annotation is not valid."value);
        return value;
    }
    private static class IdentityTableNameConverter extends CanonicalClassNameTableNameConverter
    {
        @Override
        protected String getName(String entityClassCanonicalName)
        {
            return entityClassCanonicalName;
        }
    }
New to GrepCode? Check out our FAQ X