users@glassfish.java.net

_at_OneToMany(mappedBy) - not working...

From: <glassfish_at_javadesktop.org>
Date: Mon, 06 Aug 2007 00:13:56 PDT

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.
[Message sent by forum member 'kosta2' (kosta2)]

http://forums.java.net/jive/thread.jspa?messageID=229551