| /******************************************************************************* |
| * Copyright (c) 2010, 2013 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License 2.0, which accompanies this distribution |
| * and is available at https://www.eclipse.org/legal/epl-2.0/. |
| * |
| * Contributors: |
| * Oracle - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.jpt.jpa.core.internal.jpa1.context.java; |
| |
| import org.eclipse.jpt.common.core.utility.TextRange; |
| import org.eclipse.jpt.common.utility.internal.iterable.EmptyListIterable; |
| import org.eclipse.jpt.common.utility.iterable.ListIterable; |
| import org.eclipse.jpt.jpa.core.context.RelationshipMapping; |
| import org.eclipse.jpt.jpa.core.context.RelationshipStrategy; |
| import org.eclipse.jpt.jpa.core.context.SpecifiedJoinColumn; |
| import org.eclipse.jpt.jpa.core.context.TypeMapping; |
| import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationshipStrategy; |
| import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationship; |
| import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedJoinColumn; |
| import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedJoinColumnRelationshipStrategy; |
| import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaContextModel; |
| import org.eclipse.jpt.jpa.core.jpa2.context.OverrideRelationship2_0; |
| import org.eclipse.jpt.jpa.core.jpa2.context.SpecifiedMappingRelationshipStrategy2_0; |
| import org.eclipse.jpt.jpa.db.Table; |
| |
| /** |
| * Used by |
| * {@link org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToManyRelationship#buildJoinColumnStrategy()} |
| * in a JPA 1.0 project. |
| */ |
| public class NullJavaJoinColumnRelationshipStrategy |
| extends AbstractJavaContextModel<JavaJoinColumnRelationship> |
| implements SpecifiedMappingRelationshipStrategy2_0, JavaSpecifiedJoinColumnRelationshipStrategy |
| { |
| public NullJavaJoinColumnRelationshipStrategy(JavaJoinColumnRelationship parent) { |
| super(parent); |
| } |
| |
| |
| // ********** join columns ********** |
| |
| public ListIterable<JavaSpecifiedJoinColumn> getJoinColumns() { |
| return EmptyListIterable.<JavaSpecifiedJoinColumn>instance(); |
| } |
| |
| public int getJoinColumnsSize() { |
| return 0; |
| } |
| |
| |
| // ********** specified join columns ********** |
| |
| public ListIterable<JavaSpecifiedJoinColumn> getSpecifiedJoinColumns() { |
| return EmptyListIterable.<JavaSpecifiedJoinColumn>instance(); |
| } |
| |
| public int getSpecifiedJoinColumnsSize() { |
| return 0; |
| } |
| |
| public boolean hasSpecifiedJoinColumns() { |
| return false; |
| } |
| |
| public JavaSpecifiedJoinColumn getSpecifiedJoinColumn(int index) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public JavaSpecifiedJoinColumn addSpecifiedJoinColumn() { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public JavaSpecifiedJoinColumn addSpecifiedJoinColumn(int index) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public void removeSpecifiedJoinColumn(SpecifiedJoinColumn joinColumn) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public void removeSpecifiedJoinColumn(int index) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public void clearSpecifiedJoinColumns() { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public void convertDefaultJoinColumnsToSpecified() { |
| throw new UnsupportedOperationException(); |
| } |
| |
| // ********** default join column ********** |
| |
| public JavaSpecifiedJoinColumn getDefaultJoinColumn() { |
| return null; |
| } |
| |
| |
| // ********** misc ********** |
| |
| public JavaJoinColumnRelationship getRelationship() { |
| return this.parent; |
| } |
| |
| protected RelationshipMapping getRelationshipMapping() { |
| return this.getRelationship().getMapping(); |
| } |
| |
| public String getTableName() { |
| return null; |
| } |
| |
| public TypeMapping getRelationshipSource() { |
| return this.getRelationshipMapping().getTypeMapping(); |
| } |
| |
| public TypeMapping getRelationshipTarget() { |
| return null; |
| } |
| |
| public boolean isTargetForeignKey() { |
| return false; |
| } |
| |
| public void initializeFrom(VirtualJoinColumnRelationshipStrategy oldStrategy) { |
| // NOP |
| } |
| |
| public RelationshipStrategy selectOverrideStrategy(OverrideRelationship2_0 overrideRelationship) { |
| return null; |
| } |
| |
| public void addStrategy() { |
| // NOP |
| } |
| |
| public void removeStrategy() { |
| // NOP |
| } |
| |
| public boolean isOverridable() { |
| return false; |
| } |
| |
| public boolean tableNameIsInvalid(String tableName) { |
| return true; |
| } |
| |
| public Table resolveDbTable(String tableName) { |
| return null; |
| } |
| |
| |
| // ********** validation ********** |
| |
| public TextRange getValidationTextRange() { |
| return this.getRelationship().getValidationTextRange(); |
| } |
| |
| public String getColumnTableNotValidDescription() { |
| return null; |
| } |
| } |