blob: 6a7808e2ba92fa17931e38a9c55944d29dc2a508 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2010, 2011 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
*
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
package org.eclipse.jpt.jpa.core.internal.jpa1.context;
import org.eclipse.jpt.jpa.core.context.BaseColumn;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
public class MapKeyColumnValidator
extends AbstractNamedColumnValidator<BaseColumn, BaseColumnTextRangeResolver>
{
public MapKeyColumnValidator(
PersistentAttribute persistentAttribute,
BaseColumn column,
BaseColumnTextRangeResolver textRangeResolver,
TableDescriptionProvider provider) {
super(persistentAttribute, column, textRangeResolver, provider);
}
@Override
protected TableValidator buildTableValidator() {
return new TableValidator();
}
@Override
protected String getUnresolvedNameMessage() {
return JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME;
}
@Override
protected String getVirtualAttributeUnresolvedNameMessage() {
return JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME;
}
protected class TableValidator
extends BaseColumnTableValidator
{
protected TableValidator() {
super();
}
@Override
protected String getColumnTableNotValidMessage() {
return JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID;
}
@Override
protected String getVirtualAttributeColumnTableNotValidMessage() {
return JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID;
}
}
}