FileDocCategorySizeDatePackage
MetadataLogger.javaAPI DocGlassfish v2 API15966Mon Jul 30 08:12:00 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.metadata

MetadataLogger

public class MetadataLogger extends Object
Logger class for the metadata processors. It defines the common log messages used by the metadata processors.
author
Guy Pelletier
since
TopLink EJB 3.0 Reference Implementation

Fields Summary
protected AbstractSession
session
/ public static final String ALIAS = "metadata_default_alias"; public static final String MAP_KEY_ATTRIBUTE_NAME = "metadata_default_map_key_attribute_name"; public static final String TABLE_NAME = "metadata_default_table_name"; public static final String TABLE_SCHEMA = "metadata_default_table_schema"; public static final String TABLE_CATALOG = "metadata_default_table_catalog"; public static final String JOIN_TABLE_NAME = "metadata_default_join_table_name"; public static final String JOIN_TABLE_SCHEMA = "metadata_default_join_table_schema"; public static final String JOIN_TABLE_CATALOG = "metadata_default_join_table_catalog"; public static final String SECONDARY_TABLE_NAME = "metadata_default_secondary_table_name"; public static final String SECONDARY_TABLE_SCHEMA = "metadata_default_secondary_table_schema"; public static final String SECONDARY_TABLE_CATALOG = "metadata_default_secondary_table_catalog"; public static final String COLUMN = "metadata_default_column"; public static final String PK_COLUMN = "metadata_default_pk_column"; public static final String FK_COLUMN = "metadata_default_fk_column"; public static final String SOURCE_PK_COLUMN = "metadata_default_source_pk_column"; public static final String SOURCE_FK_COLUMN = "metadata_default_source_fk_column"; public static final String TARGET_PK_COLUMN = "metadata_default_target_pk_column"; public static final String TARGET_FK_COLUMN = "metadata_default_target_fk_column"; public static final String DISCRIMINATOR_COLUMN = "metadata_default_discriminator_column"; public static final String INHERITANCE_PK_COLUMN = "metadata_default_inheritance_pk_column"; public static final String INHERITANCE_FK_COLUMN = "metadata_default_inheritance_fk_column"; public static final String SECONDARY_TABLE_PK_COLUMN = "metadata_default_secondary_table_pk_column"; public static final String SECONDARY_TABLE_FK_COLUMN = "metadata_default_secondary_table_fk_column"; public static final String ONE_TO_ONE_MAPPING = "metadata_default_one_to_one_mapping"; public static final String ONE_TO_MANY_MAPPING = "metadata_default_one_to_many_mapping"; public static final String ONE_TO_ONE_MAPPING_REFERENCE_CLASS = "metadata_default_one_to_one_reference_class"; public static final String ONE_TO_MANY_MAPPING_REFERENCE_CLASS = "metadata_default_one_to_many_reference_class"; public static final String MANY_TO_ONE_MAPPING_REFERENCE_CLASS = "metadata_default_many_to_one_reference_class"; public static final String MANY_TO_MANY_MAPPING_REFERENCE_CLASS = "metadata_default_many_to_many_reference_class"; /
protected HashMap
ctxStrings
Constructors Summary
public MetadataLogger(AbstractSession session)
INTERNAL:

        this.session = session;
        
        // Initialize the context strings.
        ctxStrings = new HashMap();
    
        // ORM specific
        ctxStrings.put(IGNORE_ID_CLASS_ELEMENT, IGNORE_ID_CLASS_ELEMENT);
        ctxStrings.put(IGNORE_TABLE_ELEMENT, IGNORE_TABLE_ELEMENT);
        ctxStrings.put(IGNORE_SECONDARY_TABLE_ELEMENT, IGNORE_SECONDARY_TABLE_ELEMENT);
        ctxStrings.put(IGNORE_NAMED_QUERY_ELEMENT, IGNORE_NAMED_QUERY_ELEMENT);
        ctxStrings.put(IGNORE_NAMED_NATIVE_QUERY_ELEMENT, IGNORE_NAMED_NATIVE_QUERY_ELEMENT);
        ctxStrings.put(IGNORE_MAPPING_ON_WRITE, IGNORE_MAPPING_ON_WRITE);
        ctxStrings.put(IGNORE_QUERY_HINT_UNSUPPORTED_TYPE, IGNORE_QUERY_HINT_UNSUPPORTED_TYPE);
        ctxStrings.put(IGNORE_QUERY_HINT_UNKNOWN_TYPE, IGNORE_QUERY_HINT_UNKNOWN_TYPE);
        ctxStrings.put(ERROR_LOADING_ORM_XML_FILE, ERROR_LOADING_ORM_XML_FILE);
        ctxStrings.put(COULD_NOT_FIND_ORM_XML_FILE, COULD_NOT_FIND_ORM_XML_FILE);
        
        // Annotation specific
        ctxStrings.put(IGNORE_ANNOTATION, IGNORE_ANNOTATION);
        ctxStrings.put(IGNORE_ID_CLASS_ANNOTATION, IGNORE_ID_CLASS_ANNOTATION);
        ctxStrings.put(IGNORE_TABLE_ANNOTATION, IGNORE_TABLE_ANNOTATION);
        ctxStrings.put(IGNORE_SECONDARY_TABLE_ANNOTATION, IGNORE_SECONDARY_TABLE_ANNOTATION);
        ctxStrings.put(IGNORE_NAMED_QUERY_ANNOTATION, IGNORE_NAMED_QUERY_ANNOTATION);
        ctxStrings.put(IGNORE_NAMED_NATIVE_QUERY_ANNOTATION, IGNORE_NAMED_NATIVE_QUERY_ANNOTATION);
        
        // Common ignore messages for ORM and annotations.
        ctxStrings.put(IGNORE_MAPPING, IGNORE_MAPPING);
        ctxStrings.put(IGNORE_LOB, IGNORE_LOB);
        ctxStrings.put(IGNORE_TEMPORAL, IGNORE_TEMPORAL);
        ctxStrings.put(IGNORE_ENUMERATED, IGNORE_ENUMERATED);
        ctxStrings.put(IGNORE_SERIALIZED, IGNORE_SERIALIZED);
        ctxStrings.put(IGNORE_INHERITANCE, IGNORE_INHERITANCE);
        ctxStrings.put(IGNORE_PRIMARY_KEY, IGNORE_PRIMARY_KEY);
        ctxStrings.put(IGNORE_EMBEDDED_ID, IGNORE_EMBEDDED_ID);
        ctxStrings.put(IGNORE_VERSION_LOCKING, IGNORE_VERSION_LOCKING);
        ctxStrings.put(IGNORE_BASIC_FETCH_LAZY, IGNORE_BASIC_FETCH_LAZY);
        
        // Common default messages for ORM and annotations.
        ctxStrings.put(ALIAS, ALIAS);
        ctxStrings.put(MAP_KEY_ATTRIBUTE_NAME, MAP_KEY_ATTRIBUTE_NAME);
        
        ctxStrings.put(TABLE_NAME, TABLE_NAME);
        ctxStrings.put(TABLE_SCHEMA, TABLE_SCHEMA);
        ctxStrings.put(TABLE_CATALOG, TABLE_CATALOG);
        
        ctxStrings.put(JOIN_TABLE_NAME, JOIN_TABLE_NAME);
        ctxStrings.put(JOIN_TABLE_SCHEMA, JOIN_TABLE_SCHEMA);
        ctxStrings.put(JOIN_TABLE_CATALOG, JOIN_TABLE_CATALOG);
        
        ctxStrings.put(SECONDARY_TABLE_NAME, SECONDARY_TABLE_NAME);
        ctxStrings.put(SECONDARY_TABLE_SCHEMA, SECONDARY_TABLE_SCHEMA);
        ctxStrings.put(SECONDARY_TABLE_CATALOG, SECONDARY_TABLE_CATALOG);
        
        ctxStrings.put(COLUMN, COLUMN);
        ctxStrings.put(PK_COLUMN, PK_COLUMN);
        ctxStrings.put(FK_COLUMN, FK_COLUMN);
        ctxStrings.put(SOURCE_PK_COLUMN, SOURCE_PK_COLUMN);
        ctxStrings.put(SOURCE_FK_COLUMN, SOURCE_FK_COLUMN);
        ctxStrings.put(TARGET_PK_COLUMN, TARGET_PK_COLUMN);
        ctxStrings.put(TARGET_FK_COLUMN, TARGET_FK_COLUMN);
        ctxStrings.put(DISCRIMINATOR_COLUMN, DISCRIMINATOR_COLUMN);
        ctxStrings.put(INHERITANCE_PK_COLUMN, INHERITANCE_PK_COLUMN);
        ctxStrings.put(INHERITANCE_FK_COLUMN, INHERITANCE_FK_COLUMN);
        ctxStrings.put(SECONDARY_TABLE_PK_COLUMN, SECONDARY_TABLE_PK_COLUMN);
        ctxStrings.put(SECONDARY_TABLE_FK_COLUMN, SECONDARY_TABLE_FK_COLUMN);
        
        ctxStrings.put(ONE_TO_ONE_MAPPING, ONE_TO_ONE_MAPPING);
        ctxStrings.put(ONE_TO_MANY_MAPPING, ONE_TO_MANY_MAPPING);
        ctxStrings.put(ONE_TO_ONE_MAPPING_REFERENCE_CLASS, ONE_TO_ONE_MAPPING_REFERENCE_CLASS);
        ctxStrings.put(ONE_TO_MANY_MAPPING_REFERENCE_CLASS, ONE_TO_MANY_MAPPING_REFERENCE_CLASS);
        ctxStrings.put(MANY_TO_ONE_MAPPING_REFERENCE_CLASS, MANY_TO_ONE_MAPPING_REFERENCE_CLASS);
        ctxStrings.put(MANY_TO_MANY_MAPPING_REFERENCE_CLASS, MANY_TO_MANY_MAPPING_REFERENCE_CLASS);
    
Methods Summary
protected java.lang.StringgetLoggingContextString(java.lang.String context)
INTERNAL: Return the logging context string for the given context.

        return (String) ctxStrings.get(context);
	
public voidlog(int level, java.lang.String ctx, java.lang.Object[] params)
INTERNAL: Logging utility method.

        session.log(level, SessionLog.EJB_OR_METADATA, getLoggingContextString(ctx), params);
    
public voidlogConfigMessage(java.lang.String ctx, oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor accessor, java.lang.Object param)
INTERNAL: Logging utility method.

        log(SessionLog.CONFIG, ctx, new Object[] { accessor.getAnnotatedElement(), param });
    
public voidlogConfigMessage(java.lang.String ctx, oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor accessor, java.lang.Object param1, java.lang.Object param2)
INTERNAL: Logging utility method.

        log(SessionLog.CONFIG, ctx, new Object[] { accessor.getJavaClass(), accessor.getAnnotatedElement(), param1, param2 });
    
public voidlogConfigMessage(java.lang.String ctx, oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor descriptor, java.lang.Object param)
INTERNAL: Logging utility method.

        log(SessionLog.CONFIG, ctx, new Object[] { descriptor.getJavaClass(), param });
    
public voidlogConfigMessage(java.lang.String ctx, java.lang.Object object)
INTERNAL: Logging utility method.

        log(SessionLog.CONFIG, ctx, new Object[] { object });    
    
public voidlogConfigMessage(java.lang.String ctx, java.lang.Object param1, java.lang.Object param2)
INTERNAL: Logging utility method.

        log(SessionLog.CONFIG, ctx, new Object[] { param1, param2 });    
    
public voidlogWarningMessage(java.lang.String ctx, java.lang.Object param)
INTERNAL: Logging utility method.

        log(SessionLog.WARNING, ctx, new Object[] { param });    
    
public voidlogWarningMessage(java.lang.String ctx, java.lang.Object param1, java.lang.Object param2)
INTERNAL: Logging utility method.

        log(SessionLog.WARNING, ctx, new Object[] { param1, param2 });    
    
public voidlogWarningMessage(java.lang.String ctx, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
INTERNAL: Logging utility method.

        log(SessionLog.WARNING, ctx, new Object[] {param1, param2, param3});
    
public voidlogWarningMessage(java.lang.String ctx, oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor accessor)
INTERNAL: Logging utility method.

        log(SessionLog.WARNING, ctx, new Object[] { accessor.getJavaClass(), accessor.getAnnotatedElement() });
    
public voidsetSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Set the session to log to.

        this.session = session;