Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » uses a non-entity as target entity in the relationship attribute
uses a non-entity as target entity in the relationship attribute [message #707859] Tue, 02 August 2011 06:34 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 12
Registered: July 2011
Junior Member
I am getting the following exception, which just started happening and I'm not sure of the problem:

Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [XXXcmsPU] failed.

Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.ValidationException

Exception Description: [class com.XXX.data.Wwwwebsites] uses a non-entity [class com.XXX.data.WWWWebsitesCategories] as target entity in the relationship attribute [field categorytypeid].

	at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:126)

	at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:136)

	at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:65)

	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)

	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)


This is the WWWWEBSITES class
@Entity
@Table(name = "WWWWEBSITES")
@NamedQueries(
    {
        @NamedQuery(name = "Wwwwebsites.findAll", query = "SELECT w FROM Wwwwebsites w"),
        @NamedQuery(name = "Wwwwebsites.findBySiteownerid", query = "SELECT w FROM Wwwwebsites w WHERE w.siteownerid = :siteownerid"),
        @NamedQuery(name = "Wwwwebsites.findByWebsitetradingname", query = "SELECT w FROM Wwwwebsites w WHERE w.websitetradingname = :websitetradingname"),
        @NamedQuery(name = "Wwwwebsites.findByWebsiteprefereddomainname", query = "SELECT w FROM Wwwwebsites w WHERE w.websiteprefereddomainname = :websiteprefereddomainname"),
        @NamedQuery(name = "Wwwwebsites.findByMetakeywords", query = "SELECT w FROM Wwwwebsites w WHERE w.metakeywords = :metakeywords"),
        @NamedQuery(name = "Wwwwebsites.findByMetadescription", query = "SELECT w FROM Wwwwebsites w WHERE w.metadescription = :metadescription"),
        @NamedQuery(name = "Wwwwebsites.findByAnalyticssiteid", query = "SELECT w FROM Wwwwebsites w WHERE w.analyticssiteid = :analyticssiteid"),
        @NamedQuery(name = "Wwwwebsites.findByCarsalesdealerid", query = "SELECT w FROM Wwwwebsites w WHERE w.carsalesdealerid = :carsalesdealerid"),
        @NamedQuery(name = "Wwwwebsites.findByWebsitetypeid", query = "SELECT w FROM Wwwwebsites w WHERE w.websitetypeid = :websitetypeid"),
        @NamedQuery(name = "Wwwwebsites.findByPermitdeeplinking", query = "SELECT w FROM Wwwwebsites w WHERE w.permitdeeplinking = :permitdeeplinking"),
        @NamedQuery(name = "Wwwwebsites.findByWebsitestatus", query = "SELECT w FROM Wwwwebsites w WHERE w.websitestatus = :websitestatus"),
        @NamedQuery(name = "Wwwwebsites.findByWebsitestatuschangedate", query = "SELECT w FROM Wwwwebsites w WHERE w.websitestatuschangedate = :websitestatuschangedate"),
        @NamedQuery(name = "Wwwwebsites.findByWebsiteupdatedtimestamp", query = "SELECT w FROM Wwwwebsites w WHERE w.websiteupdatedtimestamp = :websiteupdatedtimestamp"),
        @NamedQuery(name = "Wwwwebsites.findByWebsiteprefereddomainnameandcountryid", query = "SELECT w FROM Wwwwebsites w WHERE w.websiteprefereddomainname = :websiteprefereddomainname AND w.countryid.sitecountryid = :sitecountryid"),

        @NamedQuery(name = "Wwwwebsites.findByHomefolder", query = "SELECT w FROM Wwwwebsites w WHERE w.websitehomefolder = :websitehomefolder"),
        @NamedQuery(name = "Wwwwebsites.findByDealerid", query = "SELECT w FROM Wwwwebsites w WHERE w.dealerid = :dealerid")
    }
)

public class Wwwwebsites implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Site_owner_id")
    private Integer siteownerid;
    @Column(name = "Website_trading_name")
    private String websitetradingname;
    @Column(name = "Website_prefered_domain_name")
    private String websiteprefereddomainname;
    @Column(name = "Meta_keywords")
    private String metakeywords;

    @Column(name = "Website_homefolder")
    private String websitehomefolder;
    @Column(name = "DealerID")
    private String dealerid;

    @Column(name = "Meta_description")
    private String metadescription;
    @Column(name = "Analytics_site_id")
    private String analyticssiteid;
    @Column(name = "Carsales_dealer_id")
    private String carsalesdealerid;
    @Column(name = "Website_type_id")
    private Integer websitetypeid;
    @Column(name = "Permit_deep_linking")
    private Integer permitdeeplinking;
    @Lob
    @Column(name = "Notes")
    private String notes;
    @Column(name = "Website_status")
    private Integer websitestatus;
    @Column(name = "Website_status_change_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date websitestatuschangedate;
    @Column(name = "Website_updated_time_stamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date websiteupdatedtimestamp;
    @OneToMany(mappedBy = "siteownerid")
    private List<WWWWebsitesDomainNames> wWWWebsitesDomainNamesCollection;
    @JoinColumn(name = "Country_id", referencedColumnName = "Site_country_id")
    @ManyToOne
    private WWWWebsitesCountryType countryid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "wwwwebsites")
    private List<WWWWebsitesLocationSequence> wWWWebsitesLocationSequenceCollection;
    @OneToMany(mappedBy = "siteownerid")
    private List<WWWWebsitesLogin> wWWWebsitesLoginCollection;
    @JoinColumn(name = "Category_type_id", referencedColumnName = "Category_type_id")
    @ManyToOne
    private WWWWebsitesCategories categorytypeid;

    public Wwwwebsites() {
    }

    public Wwwwebsites(Integer siteownerid) {
        this.siteownerid = siteownerid;
    }

    public Integer getSiteownerid() {
        return siteownerid;
    }

    public void setSiteownerid(Integer siteownerid) {
        this.siteownerid = siteownerid;
    }

    public String getWebsitetradingname() {
        return websitetradingname;
    }

    public void setWebsitetradingname(String websitetradingname) {
        this.websitetradingname = websitetradingname;
    }

    public String getWebsiteprefereddomainname() {
        return websiteprefereddomainname;
    }

    public void setWebsiteprefereddomainname(String websiteprefereddomainname) {
        this.websiteprefereddomainname = websiteprefereddomainname;
    }

    public String getMetakeywords() {
        return metakeywords;
    }

    public void setMetakeywords(String metakeywords) {
        this.metakeywords = metakeywords;
    }

    public String getWebsitehomefolder() {
        return websitehomefolder;
    }

    public void setWebsitehomefolder(String hot) {
        this.websitehomefolder = hot;
    }

    public String getDealerID() {
        return dealerid;
    }

    public void setDealerID(String hot) {
        this.dealerid = hot;
    }

    public String getMetadescription() {
        return metadescription;
    }

    public void setMetadescription(String metadescription) {
        this.metadescription = metadescription;
    }

    public String getAnalyticssiteid() {
        return analyticssiteid;
    }

    public void setAnalyticssiteid(String analyticssiteid) {
        this.analyticssiteid = analyticssiteid;
    }

    public String getCarsalesdealerid() {
        return carsalesdealerid;
    }

    public void setCarsalesdealerid(String carsalesdealerid) {
        this.carsalesdealerid = carsalesdealerid;
    }

    public Integer getWebsitetypeid() {
        return websitetypeid;
    }

    public void setWebsitetypeid(Integer websitetypeid) {
        this.websitetypeid = websitetypeid;
    }

    public Integer getPermitdeeplinking() {
        return permitdeeplinking;
    }

    public void setPermitdeeplinking(Integer permitdeeplinking) {
        this.permitdeeplinking = permitdeeplinking;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Integer getWebsitestatus() {
        return websitestatus;
    }

    public void setWebsitestatus(Integer websitestatus) {
        this.websitestatus = websitestatus;
    }

    public Date getWebsitestatuschangedate() {
        return websitestatuschangedate;
    }

    public void setWebsitestatuschangedate(Date websitestatuschangedate) {
        this.websitestatuschangedate = websitestatuschangedate;
    }

    public Date getWebsiteupdatedtimestamp() {
        return websiteupdatedtimestamp;
    }

    public void setWebsiteupdatedtimestamp(Date websiteupdatedtimestamp) {
        this.websiteupdatedtimestamp = websiteupdatedtimestamp;
    }

    public List<WWWWebsitesDomainNames> getWWWWebsitesDomainNamesCollection() {
        return wWWWebsitesDomainNamesCollection;
    }

    public void setWWWWebsitesDomainNamesCollection(List<WWWWebsitesDomainNames> wWWWebsitesDomainNamesCollection) {
        this.wWWWebsitesDomainNamesCollection = wWWWebsitesDomainNamesCollection;
    }

    public WWWWebsitesCountryType getCountryid() {
        return countryid;
    }

    public void setCountryid(WWWWebsitesCountryType countryid) {
        this.countryid = countryid;
    }

    public List<WWWWebsitesLocationSequence> getWWWWebsitesLocationSequenceCollection() {
        return wWWWebsitesLocationSequenceCollection;
    }

    public void setWWWWebsitesLocationSequenceCollection(List<WWWWebsitesLocationSequence> wWWWebsitesLocationSequenceCollection) {
        this.wWWWebsitesLocationSequenceCollection = wWWWebsitesLocationSequenceCollection;
    }

    public List<WWWWebsitesLogin> getWWWWebsitesLoginCollection() {
        return wWWWebsitesLoginCollection;
    }

    public void setWWWWebsitesLoginCollection(List<WWWWebsitesLogin> wWWWebsitesLoginCollection) {
        this.wWWWebsitesLoginCollection = wWWWebsitesLoginCollection;
    }

    public WWWWebsitesCategories getCategorytypeid() {
        return categorytypeid;
    }

    public void setCategorytypeid(WWWWebsitesCategories categorytypeid) {
        this.categorytypeid = categorytypeid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (siteownerid != null ? siteownerid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Wwwwebsites)) {
            return false;
        }
        Wwwwebsites other = (Wwwwebsites) object;
        if ((this.siteownerid == null && other.siteownerid != null) || (this.siteownerid != null && !this.siteownerid.equals(other.siteownerid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.XXX.data.Wwwwebsites[siteownerid=" + siteownerid + "]";
    }

}


This is the WWWWebsitesCategories class:
@Entity
@Table(name = "WWWWebsites_Categories")
@NamedQueries({@NamedQuery(name = "WWWWebsitesCategories.findAll", query = "SELECT w FROM WWWWebsitesCategories w"), @NamedQuery(name = "WWWWebsitesCategories.findByCategorytypeid", query = "SELECT w FROM WWWWebsitesCategories w WHERE w.categorytypeid = :categorytypeid"), @NamedQuery(name = "WWWWebsitesCategories.findByCategorytypename", query = "SELECT w FROM WWWWebsitesCategories w WHERE w.categorytypename = :categorytypename"), @NamedQuery(name = "WWWWebsitesCategories.findByCategorytypestatus", query = "SELECT w FROM WWWWebsitesCategories w WHERE w.categorytypestatus = :categorytypestatus")})
public class WWWWebsitesCategories implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Category_type_id")
    private Integer categorytypeid;
    @Column(name = "Category_type_name")
    private String categorytypename;
    @Column(name = "Category_type_status")
    private Integer categorytypestatus;
    @OneToMany(mappedBy = "categorytypeid")
    private List<Wwwwebsites> wwwwebsitesList;

    public WWWWebsitesCategories() {
    }

    public WWWWebsitesCategories(Integer categorytypeid) {
        this.categorytypeid = categorytypeid;
    }

    public Integer getCategorytypeid() {
        return categorytypeid;
    }

    public void setCategorytypeid(Integer categorytypeid) {
        this.categorytypeid = categorytypeid;
    }

    public String getCategorytypename() {
        return categorytypename;
    }

    public void setCategorytypename(String categorytypename) {
        this.categorytypename = categorytypename;
    }

    public Integer getCategorytypestatus() {
        return categorytypestatus;
    }

    public void setCategorytypestatus(Integer categorytypestatus) {
        this.categorytypestatus = categorytypestatus;
    }

    public List<Wwwwebsites> getWwwwebsitesList() {
        return wwwwebsitesList;
    }

    public void setWwwwebsitesList(List<Wwwwebsites> wwwwebsitesList) {
        this.wwwwebsitesList = wwwwebsitesList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (categorytypeid != null ? categorytypeid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof WWWWebsitesCategories)) {
            return false;
        }
        WWWWebsitesCategories other = (WWWWebsitesCategories) object;
        if ((this.categorytypeid == null && other.categorytypeid != null) || (this.categorytypeid != null && !this.categorytypeid.equals(other.categorytypeid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.XXX.data.WWWWebsitesCategories[categorytypeid=" + categorytypeid + "]";
    }

}



What have I done wrong?
Re: uses a non-entity as target entity in the relationship attribute [message #708152 is a reply to message #707859] Tue, 02 August 2011 14:09 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What did you change to make it start happening?

What is your persistence.xml, have you listed all of the class? Are all of your classes in your jar, did they all compile and deploy correctly?


James : Wiki : Book : Blog : Twitter
(no subject) [message #708161 is a reply to message #707859] Tue, 02 August 2011 14:09 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
What did you change to make it start happening?

What is your persistence.xml, have you listed all of the class? Are all of your classes in your jar, did they all compile and deploy correctly?

--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: (no subject) [message #708540 is a reply to message #708152] Tue, 02 August 2011 23:09 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 12
Registered: July 2011
Junior Member
This is what my persistence.xml looks like. There is nothing that I can remember doing to cause this. Yes, I have all my classes listed, they are in my jar and they compiled properly.
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="XXXcmsPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.xxx.data.Wwwwebsites</class>
	<class>com.xxx.data.WWWWebsitesCategories</class>
    <properties>
      <property name="javax.persistence.jdbc.password" value="XXXX"/>
      <property name="javax.persistence.jdbc.user" value="XXXX"/>
      <property name="javax.persistence.jdbc.driver" value="net.sourceforge.jtds.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.url" value="jdbc:jtds:sqlserver://XXXXXXXXXXXXXX"/>
	  <property name="eclipselink.cache.shared.default" value="false"/>
	  <property name="eclipselink.allow-zero-id" value="true"/>
    </properties>
  </persistence-unit>
</persistence>
Re: (no subject) [message #713494 is a reply to message #708540] Mon, 08 August 2011 14:39 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What environment are you running in? (Glassfish, JEE, Tomcat, JSE, Spring, OSGi, etc?)

James : Wiki : Book : Blog : Twitter
(no subject) [message #713520 is a reply to message #708540] Mon, 08 August 2011 14:39 Go to previous message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
What environment are you running in? (Glassfish, JEE, Tomcat, JSE, Spring, OSGi, etc?)
--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Previous Topic:(no subject)
Next Topic:JPA2: how access entity name for projection query
Goto Forum:
  


Current Time: Tue Apr 16 17:20:57 GMT 2024

Powered by FUDForum. Page generated in 0.09227 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top