Skip to main content
summaryrefslogtreecommitdiffstats
blob: e482aa31c377f0836f6c8404fbb0b7e5580061d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##included template. Generates the @ManyToMany annotation.
##Assumes that the context has a "role" object representing the generated AssociationRole
##
#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for many-to-many)
#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
#end
#if($members!="")
	@ManyToMany($members)
#else	
    @ManyToMany
#end    
#else
#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
#end
#if($members!="")
	@ManyToMany($members)
#else	
    @ManyToMany
#end    
#parse("join.vm")
#end

Back to the top