摘要: 这个错误有点小小的纠结.想都没想就写的,,其实错误的原因就在我在映射实体的时候@ManyToOne@ Column(name="parent_id") public Module getParent() { return parent; }注意上面的 @ Column(name="parent_id")应该改为@JoinColumn(name="parent_id")就OK了 阅读全文
posted @ 2011-11-14 23:44 hibernate3例子 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: Husband.javapackagecom.one2one.bean;importjavax.persistence.CascadeType;importjavax.persistence.Column;importjavax.persistence.Entity;importjavax.persistence.GeneratedValue;importjavax.persistence.GenerationType;importjavax.persistence.Id;importjavax.persistence.OneToOne;importjavax.persistence.Tabl 阅读全文
posted @ 2011-11-14 22:35 hibernate3例子 阅读(241) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>//#include<cmath>using namespace std;int main(){ int n,c1,c2,c3; double x; while( cin >> n && n != 0) { c1 = c2 = c3 = 0; for( int i = 0;i < n;i ++) { cin >> x; if( x < 0) { c1 ++; ... 阅读全文
posted @ 2011-11-14 11:57 hibernate3例子 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>//#include<cmath>using namespace std;int main(){ double x,y; int n1,n2; while( cin >> n1 >> n2 ) { x = y = 0.0; if( n1 > n2) { swap(n1,n2); } for ( int i = n1;i <= n2;i ++) { if... 阅读全文
posted @ 2011-11-14 11:56 hibernate3例子 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>//#include<cmath>using namespace std;int main(){ int n,x,sum; while( cin >> n ) { sum = 1; for( int i = 0;i < n;i ++) { cin >> x; if( x % 2 != 0) { sum *= x; } } ... 阅读全文
posted @ 2011-11-14 11:54 hibernate3例子 阅读(103) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>//#include<cmath>using namespace std;int lev(int n){ if((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) { return 1; } else return 0; } int main(){ int month[2][13]= {{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,3... 阅读全文
posted @ 2011-11-14 11:53 hibernate3例子 阅读(157) 评论(0) 推荐(0) 编辑