Your project does not have a test pass may be the cause of your project-because the class of your project Intermediate association involves too many
Own project "Such a configuration error"
@OneToMany (Fetch=fetchtype.lazy,cascade = {Cascadetype.remove}, mappedby= "Scprojecttecapply")
@JoinColumn (name= "Busid")
Public list<scteam> Getteams () {
return teams;
}
"Post-modification Configuration"
@OneToMany (Fetch=fetchtype.lazy,cascade = {Cascadetype.remove}, mappedby= "Scprojecttecapply")
Public list<scteam> Getteams () {
return teams;
======================= Error
Could not initialize a collection:
[com.jspxcms.core.domain.scprojecttecapply.teams#2098];
SQL [Select Teams0_.scprojecttecapply as scprojec6_77_1_, teams0_.id as id1_, teams0_.id as id80_0_, Teams0_.busid as Busi d80_0_, Teams0_.deptname as deptname80_0_, Teams0_.leader as leader80_0_, teams0_.points as points80_0_, teams0_. Scprojecttecapply as scprojec6_80_0_, teams0_.uname as uname80_0_, Teams0_.weight_sort as weight8_80_0_ from Sc_team team s0_ where teams0_.scprojecttecapply=?];
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ' teams0_.scprojecttecapply ' in ' Field List '
=============
"Modified to this" still error
@OneToMany (Fetch=fetchtype.lazy,cascade = {Cascadetype.remove})
@JoinColumn (name= "Busid")
Public list<scteam> Getteams () {
return teams;
}
Could not initialize a collection:
[com.jspxcms.core.domain.scprojecttecapply.teams#2098];
SQL [Select Teams0_.busid as busid77_1_, teams0_.id as id1_, teams0_.id as id80_0_, Teams0_.busid as busid80_0_, TEAMS0_.D Eptname as deptname80_0_, Teams0_.leader as leader80_0_, teams0_.points as points80_0_, teams0_.scprojecttecapply as scprojec6_80_0_, teams0_.uname as uname80_0_, Teams0_.weight_sort as weight8_80_0_ from Sc_team teams0_ where teams 0_.busid=?];
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Unknown column 'teams0_.scprojecttecapply' in ' Field List '
=====================
"Online Information"
Exception: Associations marked as Mappedby must not define database mappings like @JoinTable or @JoinColumn
The error occurs in the following code
@OneToMany (mappedby= "parent", Fetch=fetchtype.eager,cascade=cascadetype.all)
@JoinColumn (name= "parent_id")
Private list<category> child = new arraylist<category> ();
Later found in 3.5.3 Release @joincolumn and Mappingby are mutually exclusive, before in hibernate.3.3.2 is correct, that is, hibernate.3.3.2 allow the two to exist.
So, if the upgrade to hibernate3.5.3 want to test success, mappby= "parent", should be removed, the correct configuration should be
@OneToMany (Fetch=fetchtype.eager,cascade=cascadetype.all)
@JoinColumn (name= "parent_id")
Private list<category> child = new arraylist<category> ();
Associations marked as Mappedby must not define database mappings like @JoinTable or @JoinColumn "error"