首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >javax.persistence批注是否缺少可选元素?

javax.persistence批注是否缺少可选元素?
EN

Stack Overflow用户
提问于 2016-07-19 16:37:56
回答 0查看 162关注 0票数 0

我们正在将Play框架应用程序从2.3.10升级到2.4.8,并在此基础上从Ebean 3.x升级到4.6.2。

我现在看到了编译错误,指出一些javax.persistence注释缺少字段。两个版本的Ebean都依赖于javax.persistence的1.0版本。

奇怪的是,IntelliJ显示注释缺少可选元素,但注释的Javadoc提到了可选元素。注意,编译也会在

例如,下面是IntelliJ为javax.persistence.UniqueConstraint显示的源代码

代码语言:javascript
复制
/**
 * This annotation is used to specify that a unique constraint 
 * is to be included in the generated DDL for a primary or secondary table.
 *
 * <pre>
 *    Example:
 *    &#064;Entity
 *    &#064;Table(
 *        name="EMPLOYEE", 
 *        uniqueConstraints=
 *            &#064;UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
 *    )
 *    public class Employee { ... }
 * </pre>
 *
 * @since Java Persistence 1.0
 */
@Target({TYPE}) 
@Retention(RUNTIME)

public @interface UniqueConstraint {

    /** (Required) An array of the column names that make up the constraint. */
    String[] columnNames();
}
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38453414

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档