Friday, 15 March 2013

jpa - The attribute [...] from the managed type [...] is not present (for fields with lowerCase/upperCase names -



jpa - The attribute [...] from the managed type [...] is not present (for fields with lowerCase/upperCase names -

the next error message appears

java.lang.illegalargumentexception: attribute [emailstatus] managed type [entitytypeimpl@902966747:personjpadao [ javatype: class com.bitplan.smartcrm.jpa.personjpadao descriptor: relationaldescriptor(com.bitplan.smartcrm.jpa.personjpadao --> [databasetable(person)]), mappings: 46]] not present. @ org.eclipse.persistence.internal.jpa.metamodel.managedtypeimpl.getattribute(managedtypeimpl.java:147)

while annotation , getters , setters present:

/** * getter xsd:string/string emailstatus * @return emailstatus */ @column(name="emailstatus") public string getemailstatus() { homecoming getpersonimpl().getemailstatus(); } /** * setter xsd:string/string emailstatus * @param pemailstatus - new value emailstatus */ public void setemailstatus(string pemailstatus) { getpersonimpl().setemailstatus(pemailstatus); }

my assumption naming of field relevant: if first letter of field lowercase , sec uppercase problem seems show. propertynames like:

ssn emailstatus

are o.k e.g.

emailstatus xstatus

are not.

what going on here , how debug find out how prepare this?

i guessing javabean spec capitalization rules culprit here outlined in comment of where javabean property naming convention defined?

the criteria query snippet:

path<string> beanvalue = qh.from.<string> get(beanfield);

has done emailstatus not emailstatus beanfield content - if propertie's name emailstatus , getter has uppercase "e" due java beans conventions. have not found out why yet - other answers still appreciated.

the introspector decapitalize function might helpful here.

it works rename column "emailstatus":

/** * getter xsd:string/string emailstatus * @return emailstatus */ @column(name="emailstatus") public string getemailstatus() { homecoming getpersonimpl().getemailstatus(); } /** * setter xsd:string/string emailstatus * @param pemailstatus - new value emailstatus */ public void setemailstatus(string pemailstatus) { getpersonimpl().setemailstatus(pemailstatus); }

jpa

No comments:

Post a Comment