01: package com.bm.introspectors.relations;
02:
03: import javax.persistence.OneToMany;
04:
05: import com.bm.introspectors.Property;
06:
07: /**
08: * Represents a OneToMany relelation.
09: * @author Daniel Wiese
10: *
11: */
12: public class OneToManyReleation extends AbstractRelation implements
13: EntityReleationInfo {
14:
15: /**
16: * Default constructor.
17: * @param sourceClass - the type of the source entity bean
18: * @param targetClass - the type of the target entity bean
19: * @param sourceProperty - the property of the source entity bean
20: * @param targetProperty - the property of the target entity bean
21: *
22: *
23: * @param annotation -
24: * the annotation (with values)
25: */
26: public OneToManyReleation(Class sourceClass, Class targetClass,
27: Property sourceProperty, Property targetProperty,
28: OneToMany annotation) {
29:
30: super (sourceClass, targetClass, sourceProperty, targetProperty,
31: annotation.fetch(), annotation.cascade());
32: }
33:
34: /**
35: * Returns the type of the relation.
36: * @return the relation type
37: * @see com.bm.introspectors.relations.EntityReleationInfo#getReleationType()
38: */
39: public RelationType getReleationType() {
40: return RelationType.OneToMany;
41: }
42: }
|