Results 1 to 7 of 7
Thread: What could this error be?
- 05-04-2007, 09:30 AM #1
Member
- Join Date
- Apr 2007
- Location
- Singapore
- Posts
- 29
- Rep Power
- 0
What could this error be?
Below is the error message. I'm not sure what error is this? Please help. Thank you.
???en.unknown - sg.gov.ncss.vcfms.db.DaoException: cause - java.sql.SQLException: Error executing 'insertTrgCrsCat' in 'sg/gov/ncss/vcfms/db/sqlmaps/VfsTrgCrsCatSQL.xml'. Check the Parameter Map (or inline parameters). Check the 'volunteerFlag' property. Cause: com.ibatis.common.beans.BeansException: There is no READABLE property named 'volunteerFlag' in class 'sg.gov.ncss.vcfms.training.beans.VfsTrgCrsCatDTO' ???
What i'm using is struts and sql server 2000 as the DB.
- 05-04-2007, 03:16 PM #2
Member
- Join Date
- Apr 2007
- Location
- USA
- Posts
- 50
- Rep Power
- 0
As mentioned in a previous post to you, the ??en. usually means a mapping error. First take a look at all your mapping (xml) files.Can you include some code with this, especially your VfsTrgCrsCarSQL.xml file.
- 05-06-2007, 07:16 AM #3
Member
- Join Date
- Mar 2007
- Posts
- 41
- Rep Power
- 0
Please give some attention to the "volunteerFlag" also. As derrickD it would be nice if you show us some code also
- 05-07-2007, 02:56 AM #4
Member
- Join Date
- Apr 2007
- Location
- Singapore
- Posts
- 29
- Rep Power
- 0
Below is part of the codes for VfsTrgCrsCarSQL.xml.
<result-map name="vfstrgcrscat_result" class="sg.gov.ncss.vcfms.training.beans.VfsTrgCrsC atDTO">
<property name="volunteerFlag" column="vtcc_volunteer_flag"/>
</result-map>
<mapped-statement name="insertTrgCrsCat">
INSERT INTO vfs_trg_crs_cat (vtcc_volunteer_flag)
VALUES (#volunteerFlag#)
</mapped-statement>
There are other property as well but i only show the property for volunteerFlag.
- 05-07-2007, 05:46 PM #5
Member
- Join Date
- Apr 2007
- Location
- Indiana
- Posts
- 83
- Rep Power
- 0
So when you run the insert statement "INSERT INTO vfs_trg_crs_cat (vtcc_volunteer_flag) VALUES (#volunteerFlag#)" does the value of volunteerFlag look like a "Y" or something like that? What is the column vtcc_volunteer_flag in the database? Is it a string?
Also, is there a really a space in the name class =sg.gov.ncss.vcfms.training.beans.VfsTrgCrsCatDTO' in your mapping or is that just an artifact of copying?
- 05-08-2007, 03:37 AM #6
Member
- Join Date
- Apr 2007
- Location
- Singapore
- Posts
- 29
- Rep Power
- 0
volunteerFlag is a ddl where user will specify "yes" or "no". In the DB, the column name is called vtcc_volunteer_flag. The data type is char. The data recorded will be yes or no. In my mapping class, it is
class =sg.gov.ncss.vcfms.training.beans.VfsTrgCrsCatDTO'
without the space. Don't know why it just doesn't get inserted into the DB.
- 05-08-2007, 03:26 PM #7
Member
- Join Date
- Apr 2007
- Location
- Indiana
- Posts
- 83
- Rep Power
- 0
It is more or less a boolean then. When I have a char field in Oracle and it is a Yes/No type thing I make the field a boolean in java and in the hibernate mapping I use the org.hibernate.type.YesNoType. Here is an example of the mapping, that is Y if the person is a member and N if they are not.
In my class it is boolean so I can say if(member).
<property name="member" type="org.hibernate.type.YesNoType">
<column name="MEMBER" />
</property>


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks