Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2011 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Annotation for fields that relate to other entities via relationships. The fields represent read only iterators that provide the relationship-entities RelationshipEntity of the relationships. The iterator reflects the underlying relationships.
 @RelatedToVia([type="roles"], elementClass=Role.class)
 Iterator<Role> roles;

Michael Hunger
public @interface RelatedToVia {

name of the relationship type, optional, can be inferred from the field name
    String type() default "";


direction for the relationship, by default outgoing
    // FQN is a fix for javac compiler bug

target relationship entity class, optional
    Class<?> elementClass() default Object.class;
New to GrepCode? Check out our FAQ X