赞
踩
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface OneToOne { /** * (Optional) The entity class that is the target of * the association. * * <p> Defaults to the type of the field or property * that stores the association. */ Class targetEntity() default void.class; /** * (Optional) The operations that must be cascaded to * the target of the association. * * <p> By default no operations are cascaded. */ CascadeType[] cascade() default {}; /** * (Optional) Whether the association should be lazily * loaded or must be eagerly fetched. The EAGER * strategy is a requirement on the persistence provider runtime that * the associated entity must be eagerly fetched. The LAZY * strategy is a hint to the persistence provider runtime. */ FetchType fetch() default EAGER; /** * 如果设置为false时,其值必须不能为null * (Optional) Whether the association is optional. If set * to false then a non-null relationship must always exist. */ boolean optional() default true; /** * 拥有mappedBy注解的实体类为关系被维护端 * (Optional) The field that owns the relationship. This * element is only specified on the inverse (non-owning) * side of the association. */ String mappedBy() default ""; /** * (Optional) Whether to apply the remove operation to entities that have * been removed from the relationship and to cascade the remove operation to * those entities. * @since 2.0 */ boolean orphanRemoval() default false; }
注:
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface OneToMany { /** * (Optional) The entity class that is the target * of the association. Optional only if the collection * property is defined using Java generics. * Must be specified otherwise. * * <p> Defaults to the parameterized type of * the collection when defined using generics. */ Class targetEntity() default void.class; /** * (Optional) The operations that must be cascaded to * the target of the association. * <p> Defaults to no operations being cascaded. * * <p> When the target collection is a {@link java.util.Map * java.util.Map}, the <code>cascade</code> element applies to the * map value. */ CascadeType[] cascade() default {}; /** (Optional) Whether the association should be lazily loaded or * must be eagerly fetched. The EAGER strategy is a requirement on * the persistence provider runtime that the associated entities * must be eagerly fetched. The LAZY strategy is a hint to the * persistence provider runtime. */ FetchType fetch() default LAZY; /** * The field that owns the relationship. Required unless * the relationship is unidirectional. */ String mappedBy() default ""; /** * (Optional) Whether to apply the remove operation to entities that have * been removed from the relationship and to cascade the remove operation to * those entities. * @since 2.0 */ boolean orphanRemoval() default false; }
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface ManyToOne { /** * (Optional) The entity class that is the target of * the association. * * <p> Defaults to the type of the field or property * that stores the association. */ Class targetEntity() default void.class; /** * (Optional) The operations that must be cascaded to * the target of the association. * * <p> By default no operations are cascaded. */ CascadeType[] cascade() default {}; /** * (Optional) Whether the association should be lazily * loaded or must be eagerly fetched. The EAGER * strategy is a requirement on the persistence provider runtime that * the associated entity must be eagerly fetched. The LAZY * strategy is a hint to the persistence provider runtime. */ FetchType fetch() default EAGER; /** * (Optional) Whether the association is optional. If set * to false then a non-null relationship must always exist. */ boolean optional() default true; }
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface ManyToMany { /** * (Optional) The entity class that is the target of the * association. Optional only if the collection-valued * relationship property is defined using Java generics. Must be * specified otherwise. * * <p> Defaults to the parameterized type of * the collection when defined using generics. */ Class targetEntity() default void.class; /** * (Optional) The operations that must be cascaded to the target * of the association. * * <p> When the target collection is a {@link java.util.Map * java.util.Map}, the <code>cascade</code> element applies to the * map value. * * <p> Defaults to no operations being cascaded. */ CascadeType[] cascade() default {}; /** (Optional) Whether the association should be lazily loaded or * must be eagerly fetched. The EAGER strategy is a requirement on * the persistence provider runtime that the associated entities * must be eagerly fetched. The LAZY strategy is a hint to the * persistence provider runtime. */ FetchType fetch() default LAZY; /** * The field that owns the relationship. Required unless * the relationship is unidirectional. */ String mappedBy() default ""; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。