0

I'm trying to insert into my database table, which I set up with hibernate/Spring, and I'm getting the following error

The class 'Layouts' does not have the property 'SubjectName'

The error is coming from the line

input type="text" name="SubjectName" size="50" value="${fn:escapeXml(layout.SubjectName)}"

but I clearly have SubjectName defined in my 'Layouts' model file as a String, and its in my hbm.xml file as

property name="SubjectName" type="string" column="SUBJECT"/

I also can't select form the database, although it's not giving an error. I feel like its coming from the same root problem

1 Answer 1

1

Since Hibernate relies so much on convention, I'd check to make sure that the property name is "subjectName", not "SubjectName".

Java's coding conventions and Java Bean standards say that member names should start with a lower case character and provide getter/setter access. So private data member "foo" would have "getFoo" and "setFoo" methods.

Are you using Hibernate field or property access? I'd recommend field access.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I changed all SubjectName to lowercase subjectName and the error actually went away. That's so ridiculous. Now its telling me that when I try to validate/save the data with ((LayoutManager)pageContext.getAttribute("layoutManager")).saveLayout((Layouts)pageContext.getAttribute("layout"))' that java.sql.SQLException: ORA-02289: sequence does not exist
No, your failure to follow the conventions is ridiculous. Accept the answer - I'd prefer that to your thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.