Skip to main content

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

Because getDParent might be using an attribute name of dParent, have you tried using "select model from SCfBusy model where model.dParentId= :propertyValue"?

Best Regards,
Chris

Mark Horstmeier wrote:

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.

------------------------------------------------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top