当前位置:编程学习 > JAVA >>

hibernate @OneToOne

package com.struts2.bbs.model;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
public class Wife {
private Integer id;
private Husband husband;

@Id
public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

@OneToOne(mappedBy="Wife")
public Husband gethusband() {
return husband;
}

public void setHeart(Husband husband) {
this.husband = husband;
}
}

17:17:03,894 DEBUG AnnotationBinder:532 - Binding entity from annotated class: com.struts2.bbs.model.Wife
17:17:03,894 DEBUG Ejb3Column:196 - Binding column: Ejb3DiscriminatorColumn{logicalColumnName'DTYPE', discriminatorTypeName='string'}
17:17:03,894 DEBUG AnnotationBinder:990 - No value specified for 'javax.persistence.sharedCache.mode'; using UNSPECIFIED
17:17:03,894 DEBUG EntityBinder:394 - Import with entity name Wife
17:17:03,894 DEBUG EntityBinder:564 - Bind entity com.struts2.bbs.model.Wife on table Wife
17:17:03,897 DEBUG Ejb3Column:196 - Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Wife), mappingColumn=id, insertable=true, updatable=true, unique=false}
17:17:03,897 DEBUG PropertyBinder:179 - MetadataSourceProcessor property id with lazy=false
17:17:03,898 DEBUG SimpleValueBinder:331 - building SimpleValue for id
17:17:03,898 DEBUG PropertyBinder:260 - Building property id
17:17:03,899 DEBUG Ejb3Column:196 - Binding column: Ejb3JoinColumn{logicalColumnName='null', referencedColumn='null', mappedBy='Wife'}
17:17:03,899 DEBUG Ejb3Column:196 - Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Wife), mappingColumn=husband, insertable=true, updatable=true, unique=false}

日志文件,执行到这里就不执行了

Hibernate
补充:Java ,  Java EE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,