kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2011 Oracle. All rights reserved. |
| 3 | * This program and the accompanying materials are made available under the |
| 4 | * terms of the Eclipse Public License v1.0, which accompanies this distribution |
| 5 | * and is available at http://www.eclipse.org/legal/epl-v10.html. |
| 6 | * |
| 7 | * Contributors: |
| 8 | * Oracle - initial API and implementation |
| 9 | ******************************************************************************/ |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 10 | package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 11 | |
| 12 | import org.eclipse.jpt.common.core.utility.TextRange; |
| 13 | import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable; |
| 14 | import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; |
| 15 | import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode; |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 16 | import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3; |
| 17 | import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3; |
| 18 | import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3; |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 19 | import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping; |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 20 | import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3; |
| 21 | import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3; |
| 22 | import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3; |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 23 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 24 | public class NullOrmEclipseLinkMultitenancy2_3 |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 25 | extends AbstractOrmXmlContextNode |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 26 | implements OrmEclipseLinkMultitenancy2_3 |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 27 | { |
| 28 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 29 | public NullOrmEclipseLinkMultitenancy2_3(OrmEclipseLinkNonEmbeddableTypeMapping parent) { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 30 | super(parent); |
| 31 | } |
| 32 | |
kmoore | 7fe1ca1 | 2011-10-04 12:35:33 +0000 | [diff] [blame] | 33 | |
| 34 | // ********** multitenant ********** |
| 35 | |
| 36 | public boolean isMultitenant() { |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | public boolean isDefaultMultitenant() { |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | public boolean isSpecifiedMultitenant() { |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | public void setSpecifiedMultitenant(boolean isMultitenant) { |
| 49 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 50 | } |
| 51 | |
| 52 | |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 53 | // ********** type ********** |
| 54 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 55 | public EclipseLinkMultitenantType2_3 getType() { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 56 | return null; |
| 57 | } |
| 58 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 59 | public EclipseLinkMultitenantType2_3 getSpecifiedType() { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 60 | return null; |
| 61 | } |
| 62 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 63 | public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 64 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 65 | } |
| 66 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 67 | public EclipseLinkMultitenantType2_3 getDefaultType() { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 68 | return null; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | // ********** include criteria ********** |
| 73 | |
| 74 | public boolean isIncludeCriteria() { |
| 75 | return false; |
| 76 | } |
| 77 | |
| 78 | public Boolean getSpecifiedIncludeCriteria() { |
| 79 | return null; |
| 80 | } |
| 81 | |
| 82 | public void setSpecifiedIncludeCriteria(Boolean includeCriteria) { |
| 83 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 84 | } |
| 85 | |
| 86 | public boolean isDefaultIncludeCriteria() { |
| 87 | return false; |
| 88 | } |
| 89 | |
| 90 | |
| 91 | |
| 92 | // ********** tenant discriminator columns ********** |
| 93 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 94 | public ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() { |
kmoore | 7fe1ca1 | 2011-10-04 12:35:33 +0000 | [diff] [blame] | 95 | return EmptyListIterable.instance(); |
| 96 | } |
| 97 | |
| 98 | public int getTenantDiscriminatorColumnsSize() { |
| 99 | return 0; |
| 100 | } |
| 101 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 102 | public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 103 | return EmptyListIterable.instance(); |
| 104 | } |
| 105 | |
| 106 | public int getSpecifiedTenantDiscriminatorColumnsSize() { |
| 107 | return 0; |
| 108 | } |
| 109 | |
kmoore | 7fe1ca1 | 2011-10-04 12:35:33 +0000 | [diff] [blame] | 110 | public boolean hasSpecifiedTenantDiscriminatorColumns() { |
| 111 | return false; |
| 112 | } |
| 113 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 114 | public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 115 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 116 | } |
| 117 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 118 | public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 119 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 120 | } |
| 121 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 122 | public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) { |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 123 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 124 | } |
| 125 | |
| 126 | public void removeSpecifiedTenantDiscriminatorColumn(int index) { |
| 127 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 128 | } |
| 129 | |
| 130 | public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) { |
| 131 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 132 | } |
| 133 | |
| 134 | public TextRange getValidationTextRange() { |
| 135 | throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$ |
| 136 | } |
kmoore | 7fe1ca1 | 2011-10-04 12:35:33 +0000 | [diff] [blame] | 137 | |
kmoore | 6a7396c | 2011-10-07 12:53:14 +0000 | [diff] [blame] | 138 | public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() { |
kmoore | 7fe1ca1 | 2011-10-04 12:35:33 +0000 | [diff] [blame] | 139 | return EmptyListIterable.instance(); |
| 140 | } |
| 141 | |
| 142 | public int getDefaultTenantDiscriminatorColumnsSize() { |
| 143 | return 0; |
| 144 | } |
| 145 | |
kmoore | e7b7d66 | 2011-10-21 18:24:03 +0000 | [diff] [blame] | 146 | public boolean specifiedTenantDiscriminatorColumnsAllowed() { |
| 147 | return false; |
| 148 | } |
kmoore | c6bc026 | 2011-09-14 19:39:22 +0000 | [diff] [blame] | 149 | } |