Select Categories Below
Status: Closed Points: 200 Time: 08:16 - Sep 29, 2008
dustPuppy
Hi, I am getting this error after I added a formula to a class: Value cannot be null. Parameter name: fieldName The formula is: <property name="AnswersCount" formula="(SELECT COUNT(A.postid) FROM Answerpost as A WHERE A.Userid = id)" insert="false" type="Int32" /> I suppose that it's because the formula returns null, but I can't find a way to get around it. I'd appreciate any help or directions...
Categories:
Add Categories
When adding more than one category, separate them with commas.
Advertisement
nidhi
Date:: Sep 29, 2008
Time:: 18:31
Im currently using Hibernate with Spring in Java. Now I know you are using asp.net but the basic concepts should be the same. The hibernate queries I use reference a class, and we have hibernate mapping (xml) files that map variables inside a class to a column in the table It looks like you got normal sql, I wonder if you need to use it as Hibernate expects? I do not use formula's like you do as Ive coded it with the class querying. XML files simply used to map (*.hbm.xml)
Date:: Sep 30, 2008
Time:: 05:41
Hi Nidhi, As far as I've read formulas have to be sql, hql won't work there. But I figured out what the problem was. In this particular case I had created a sql query instead of using the hql, in order to get a particular result set of the user class that this formula is part of. So the sql was not adding the AnswersCount "virtual" property and that was why it was giving an error.
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
how do i open a file dialog in .net (a windows application)?
When trying to alter a table in MySQL, I get "Error on rename... (Errcode: 13)"
how do i delete a top domain cookie from a subdomain?
Hi Am Rakesh, Am generating User Data List, Details Given Below.Please Help Me.
What is some free software for recording the movements on your computer screen t...
Good project management software?
You have 100 characters to use
Rank
Expert
Points
1.
55
2.
25
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software Real Estate Postcards Marketing Fulfillment