Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Find by property name failed (unknown state or association field)

Here is the error:

--

Caused by: Exception [EclipseLink-8030] (Eclipse Persistence Services - 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.JPQLException

Exception Description: Error compiling the query [select model from SCfBusy model where model.DParentId= :propertyValue], line 1, column 44: unknown state or association field [DParentId] of class [xxx.xxx.xxx.feature.standard.SCfBusy].

      at org.eclipse.persistence.exceptions.JPQLException.unknownAttribute(JPQLException.java:450)

      at org.eclipse.persistence.internal.jpa.parsing.DotNode.validate(DotNode.java:77)

--

 

My database is SQL Server and the table is defined as follows:

--

                    create table "xxxx"."dbo"."s_cf_busy"(

        "data_id" int identity not null,

       "crid" int not null,

       "d_custid" int not null,

       "d_active" char(1) not null,

       "timestamp" timestamp null,

       "busy" varchar(254) null,

       "d_struct_id" int null,

       "d_parent_id" int null,

       "d_parent_type" int null,

       "enable" varchar(50) null,

        constraint "PK_s_cf_busy" primary key ("data_id")

    )

go

 

    create unique index "PK_s_cf_busy" on "xxxx"."dbo"."s_cf_busy"("data_id")

go

    create unique index "s_cf_busy_id" on "xxxx"."dbo"."s_cf_busy"("data_id")

go

    create index "s_cf_busy_crid" on "xxxx"."dbo"."s_cf_busy"("crid")

go

               

--

 

The bean has:

--

@Entity

@Table(name = "s_cf_busy", schema = "dbo", catalog = "xxxx")

public class SCfBusy implements java.io.Serializable {

 

      @Column(name = "d_parent_id")

      public Integer getDParentId() {

            return this.DParentId;

      }

 

 

--

 

FYI: findAll() works so I try

--

                      List<SCfBusy> l = dao.findAll();

            Iterator< SCfBusy > iter = l.iterator();

            while (iter.hasNext()) {

                  if (sbusy.getDParentId()==null)

                        continue;

                  SCfBusy sbusy = iter.next();

                  if (sbusy.getDParentId().compareTo( id)==0)

                        features.add(sbusy);

            }

--

For obvious reasons, I would prefer to not have to resort to this workaround.

 

 


Back to the top