Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

@OneToMany(mappedBy) - not working...

843830Aug 6 2007
Hi,...

I have 2 Entities:

Website (long id, String uri) and Crawl (long id, Date ts, String html)

connecting these 2 entities:

Website:
@OneToMany
private List<Crawl> crawls;

Crawl:
@ManyToOne
private Website website;

This works fine, but the application server creates 3 tables.... website, crawl and website_crawl...

Is there a way to tell the appserver to create only 2 tables and and add a website_id column to the crawl table?

I tried mappedBy="Crawl" or mappedBy="Website" and got this:
Exception Description: The attribute [site] in entity class [class sam.core.ejb.Website] has a mappedBy value of [Website] which does not exist in its owning entity class [class sam.core.ejb.Crawl]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2007
Added on Aug 6 2007
0 comments
155 views