简体   繁体   English

为什么我的Toplink描述符没有在JDeveloper的结构面板中反映Java代码?

[英]Why don't my Toplink descriptors reflect the Java Code in the structure panel in JDeveloper?

I am currently learning Oracle ADF, including the TopLink ORM. 我目前正在学习Oracle ADF,包括TopLink ORM。 Well, I think TopLink is an ORM, correct me if I am wrong. 好吧,我认为TopLink是一个ORM,如果我做错了,请纠正我。 I Added a connection to a sqlite database, and generated a bunch of Java class. 我添加了一个到sqlite数据库的连接,并生成了一堆Java类。 I am using the Chinook example database . 我正在使用Chinook示例数据库

The wizard did not found foreign key mapping, so I tried adding one-to-many relationship between the Artist class and the Album class. 该向导未找到外键映射,因此我尝试在Artist类和Album类之间添加一对多关系。 I added a List<Album> field in the Artist class. 我在Artist类中添加了List<Album>字段。

public class Artist implements Serializable {

    // Existing fields, default constructor and get/set omitted

    //...
    private List<Album> albums;

    public Artist(int artistid, String name, /* added this */ List<Album> albums) {
        this.artistId = artistid;
        this.name = name;
        this.albums = albums;
    }

    //...
    public List<Album> getAlbums() {
        return this.albums;
    }

    public void setAlbums(List<Album> albums) {
        this.albums = albums;
    }

}

I then tried to told TopLink that the album list had a one to many relationship with the Album elements. 然后,我试图告诉TopLink,专辑列表与Album元素具有一对多的关系。 But when I opened the TopLink mapping and tried to edit the descriptor, my new field was not present in the "Structure" panel. 但是,当我打开TopLink映射并尝试编辑描述符时,“结构”面板中没有新字段。 I tried looking for a refresh button, but I found none. 我尝试寻找刷新按钮,但没有找到。 There was no "add field" either. 也没有“添加字段”。 I googled like crazy and did not found anything. 我疯狂地搜索,没有发现任何东西。 Strange thing is, I restarted JDeveloper, and suddenly my albums field was there, and I was able to set a one-to-many relationship on it... 奇怪的是,我重新启动了JDeveloper,突然我的albums字段出现了,并且我能够在它上建立一对多的关系...

So really, my question is : is there a way to make the field appear without restarting JDeveloper? 所以说真的,我的问题是:有没有一种方法可以使该字段出现而无需重新启动JDeveloper? That could get old pretty fast. 那可能很快就会变老。

The problem disappeared after a few reboot. 重新启动几次后,问题消失了。 It was probably a bug in JDeveloper. 这可能是JDeveloper中的错误。 The solution is the classic "three R" of computer troubleshooting. 解决方案是计算机故障排除的经典“三R”。

  1. Restart JDeveloper, so that the TopLink Structure panel reflect the Java Code 重新启动JDeveloper,以便TopLink Structure面板反映Java代码。
  2. Reboot your computer. 重新启动计算机。
  3. Reinstall JDeveloper 重新安装JDeveloper

Inconvenient... but it works. 不方便...但是可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM