1 21 package oracle.toplink.essentials.internal.ejb.cmp3.metadata; 23 24 import java.lang.reflect.*; 25 26 import oracle.toplink.essentials.exceptions.ValidationException; 27 import oracle.toplink.essentials.mappings.DatabaseMapping; 28 29 36 public class MetadataValidator { 37 40 public void throwConflictingSequenceAndTableGeneratorsSpecified(String name, String sequenceGeneratorLocation, String tableGeneratorLocation) { 41 throw ValidationException.conflictingSequenceAndTableGeneratorsSpecified(name, sequenceGeneratorLocation, tableGeneratorLocation); 42 } 43 44 47 public void throwConflictingSequenceGeneratorsSpecified(String name, String location1, String location2) { 48 throw ValidationException.conflictingSequenceGeneratorsSpecified(name, location1, location2); 49 } 50 51 54 public void throwConflictingSequenceNameAndTablePkColumnValueSpecified(String name, String sequenceGeneratorLocation, String tableGeneratorLocation) { 55 throw ValidationException.conflictingSequenceNameAndTablePkColumnValueSpecified(name, sequenceGeneratorLocation, tableGeneratorLocation); 56 } 57 58 61 public void throwConflictingTableGeneratorsSpecified(String name, String location1, String location2) { 62 throw ValidationException.conflictingTableGeneratorsSpecified(name, location1, location2); 63 } 64 65 68 public void throwCouldNotFindMapKey(String fieldOrPropertyName, Class referenceClass, DatabaseMapping mapping) { 69 throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceClass, mapping); 70 } 71 72 75 public void throwEmbeddedIdAndIdFound(Class entityClass, String attributeName, String idAttributeName) { 76 throw ValidationException.embeddedIdAndIdAnnotationFound(entityClass, attributeName, idAttributeName); 77 } 78 79 82 public void throwErrorProcessingNamedQueryAnnotation(Class entityClass, String name, Exception exception) { 83 throw ValidationException.errorProcessingNamedQueryAnnotation(entityClass, name, exception); 84 } 85 86 89 public void throwExcessiveJoinColumnsSpecified(Class entityClass, Object element) { 90 throw ValidationException.excessiveJoinColumnsSpecified((AnnotatedElement) element, entityClass); 91 } 92 93 96 public void throwExcessivePrimaryKeyJoinColumnsSpecified(Class entityClass, AnnotatedElement element) { 97 throw ValidationException.excessivePrimaryKeyJoinColumnsSpecified(element); 98 } 99 100 103 public void throwIncompleteJoinColumnsSpecified(Class entityClass, Object element) { 104 throw ValidationException.incompleteJoinColumnsSpecified((AnnotatedElement) element, entityClass); 105 } 106 107 110 public void throwIncompletePrimaryKeyJoinColumnsSpecified(Class entityClass, AnnotatedElement annotatedElement) { 111 throw ValidationException.incompletePrimaryKeyJoinColumnsSpecified(annotatedElement); 112 } 113 114 115 118 public void throwInvalidCompositePKSpecification(Class entityClass, String idClassName) { 119 throw ValidationException.invalidCompositePKSpecification(entityClass, idClassName); 120 } 121 122 125 public void throwInvalidEmbeddableAttribute(Class entityClass, String attributeName, Class embeddedClass, String embeddedAttributeName) { 126 throw ValidationException.invalidEmbeddableAttribute(embeddedClass, embeddedAttributeName, entityClass, attributeName); 127 } 128 129 132 public void throwInvalidOrderByValue(Class entityClass, String propertyOrFieldName, Class referenceClass, String attributeName) { 133 throw ValidationException.invalidOrderByValue(propertyOrFieldName, referenceClass, attributeName, entityClass); 134 } 135 136 139 public void throwInvalidTypeForEnumeratedAttribute(Class entityClass, String attributeName, Class referenceClass) { 140 throw ValidationException.invalidTypeForEnumeratedAttribute(attributeName, referenceClass, entityClass); 141 } 142 143 146 public void throwInvalidTypeForLOBAttribute(Class entityClass, String attributeName, Class referenceClass) { 147 throw ValidationException.invalidTypeForLOBAttribute(attributeName, referenceClass, entityClass); 148 } 149 150 153 public void throwInvalidTypeForSerializedAttribute(Class entityClass, String attributeName, Class referenceClass) { 154 ValidationException.invalidTypeForSerializedAttribute(attributeName, referenceClass, entityClass); 155 } 156 157 160 public void throwInvalidTypeForTemporalAttribute(Class entityClass, String attributeName, Class referenceClass) { 161 throw ValidationException.invalidTypeForTemporalAttribute(attributeName, referenceClass, entityClass); 162 } 163 164 167 public void throwInvalidTypeForVersionAttribute(Class entityClass, String attributeName, Class lockingType) { 168 throw ValidationException.invalidTypeForVersionAttribute(attributeName, lockingType, entityClass); 169 } 170 171 174 public void throwMappingAnnotationsAppliedToTransientAttribute(AnnotatedElement annotatedElement) { 175 throw ValidationException.mappingAnnotationsAppliedToTransientAttribute(annotatedElement); 176 } 177 178 181 public void throwMultipleEmbeddedIdsFound(Class entityClass, String attributeName, String embeddedIdAttributeName) { 182 throw ValidationException.multipleEmbeddedIdAnnotationsFound(entityClass, attributeName, embeddedIdAttributeName); 183 } 184 185 188 public void throwNoCorrespondingSetterMethodDefined(Class entityClass, Method method) { 189 throw ValidationException.noCorrespondingSetterMethodDefined(entityClass, method); 190 } 191 192 195 public void throwNoMappedByAttributeFound(Class owningClass, String owningAttributeName, Class entityClass, String attributeName) { 196 throw ValidationException.noMappedByAttributeFound(owningClass, owningAttributeName, entityClass, attributeName); 197 } 198 199 202 public void throwNonUniqueEntityName(String clsName1, String clsName2, String name) { 203 throw ValidationException.nonUniqueEntityName(clsName1, clsName2, name); 204 } 205 206 209 public void throwNoPrimaryKeyAnnotationsFound(Class entityClass) { 210 throw ValidationException.noPrimaryKeyAnnotationsFound(entityClass); 211 } 212 213 216 public void throwNoTemporalTypeSpecified(Class entityClass, String attributeName) { 217 throw ValidationException.noTemporalTypeSpecified(attributeName, entityClass); 218 } 219 220 223 public void throwOnlyOneGeneratedValueIsAllowed(Class entityClass, String existingField, String otherField) { 224 throw ValidationException.onlyOneGeneratedValueIsAllowed(entityClass, existingField, otherField); 225 } 226 227 230 public void throwRelationshipHasColumnSpecified(Class entityClass, String attributeName) { 231 throw ValidationException.invalidColumnAnnotationOnRelationship(entityClass, attributeName); 232 } 233 234 237 public void throwSequenceGeneratorUsingAReservedName(String location, String reservedName) { 238 throw ValidationException.sequenceGeneratorUsingAReservedName(reservedName, location); 239 } 240 241 244 public void throwTableGeneratorUsingAReservedName(String location, String reservedName) { 245 throw ValidationException.tableGeneratorUsingAReservedName(reservedName, location); 246 } 247 248 251 public void throwUnableToDetermineClassForField(String attributeName, Class entityClass) { 252 throw ValidationException.unableToDetermineClassForField(attributeName, entityClass); 253 } 254 255 258 public void throwUnableToDetermineClassForProperty(String attributeName, Class entityClass) { 259 throw ValidationException.unableToDetermineClassForProperty(attributeName, entityClass); 260 } 261 262 265 public void throwUniDirectionalOneToManyHasJoinColumnSpecified(Class entityClass, String attributeName) { 266 throw ValidationException.uniDirectionalOneToManyHasJoinColumnAnnotations(entityClass, attributeName); 267 } 268 269 273 277 280 public void throwIvalidMappingEncountered(Class entityClass, Class targetClass){ 281 throw ValidationException.invalidMapping(entityClass, targetClass); 282 } 283 284 292 public void throwConflictingAccessTypeInEmbeddable(Class embeddableClass) { 293 throw ValidationException.conflictingAccessTypeForEmbeddable(embeddableClass); 294 } 295 296 302 public void throwInvalidEmbeddedAttribute( 303 Class javaClass, String attributeName, Class embeddableClass) { 304 throw ValidationException.invalidEmbeddedAttribute( 305 javaClass, attributeName, embeddableClass); 306 } 307 308 313 public void throwBothFieldsAndPropertiesAnnotatedException(Class javaClass) { 314 throw ValidationException.bothFieldsAndPropertiesAnnotated(javaClass); 315 } 316 317 323 public void throwIncorrectOverridingOfAccessType( 324 Class javaClass, String xmlAccessType, String annotAccessType) { 325 throw ValidationException.incorrectOverridingOfAccessType(javaClass, xmlAccessType, annotAccessType); 326 } 327 } 328 | Popular Tags |