} else if (accessibleObject.isId(getDescriptor())) {
return new IdAccessor(accessibleObject.getAnnotation(Id.class), accessibleObject, this);
} else if (accessibleObject.isVersion(getDescriptor())) {
return new VersionAccessor(accessibleObject.getAnnotation(Version.class), accessibleObject, this);
} else if (accessibleObject.isBasic(getDescriptor())) {
return new BasicAccessor(accessibleObject.getAnnotation(Basic.class), accessibleObject, this);
} else if (accessibleObject.isEmbedded(getDescriptor())) {
return new EmbeddedAccessor(accessibleObject.getAnnotation(Embedded.class), accessibleObject, this);
} else if (accessibleObject.isEmbeddedId(getDescriptor())) {
return new EmbeddedIdAccessor(accessibleObject.getAnnotation(EmbeddedId.class), accessibleObject, this);
} else if (accessibleObject.isTransformation(getDescriptor())) {
return new TransformationAccessor(accessibleObject.getAnnotation(Transformation.class), accessibleObject, this);
} else if (accessibleObject.isManyToMany(getDescriptor())) {
return new ManyToManyAccessor(accessibleObject.getAnnotation(ManyToMany.class), accessibleObject, this);
} else if (accessibleObject.isManyToOne(getDescriptor())) {
return new ManyToOneAccessor(accessibleObject.getAnnotation(ManyToOne.class), accessibleObject, this);
} else if (accessibleObject.isOneToMany(getDescriptor())) {
// A OneToMany can default, that is, doesn't require an
// annotation to be present.
return new OneToManyAccessor(accessibleObject.getAnnotation(OneToMany.class), accessibleObject, this);
} else if (accessibleObject.isOneToOne(getDescriptor())) {
// A OneToOne can default, that is, doesn't require an
// annotation to be present.
return new OneToOneAccessor(accessibleObject.getAnnotation(OneToOne.class), accessibleObject, this);
} else if (accessibleObject.isVariableOneToOne(getDescriptor())) {
// A VariableOneToOne can default, that is, doesn't require
// an annotation to be present.
return new VariableOneToOneAccessor(accessibleObject.getAnnotation(VariableOneToOne.class), accessibleObject, this);
} else if (getDescriptor().ignoreDefaultMappings()) {
return null;
} else {
// Default case (everything else falls into a Basic)
return new BasicAccessor(accessibleObject.getAnnotation(Basic.class), accessibleObject, this);
}
}