manytoone.java

来自「介绍了hibernate的入门有一些基本常用的事例」· Java 代码 · 共 49 行

JAVA
49
字号
//$Id: ManyToOne.java,v 1.10 2005/04/03 01:52:15 oneovthafew Exp $package org.hibernate.mapping;import org.hibernate.MappingException;import org.hibernate.type.EntityType;import org.hibernate.type.Type;import org.hibernate.type.TypeFactory;/** * A many-to-one association mapping * @author Gavin King */public class ManyToOne extends ToOne {		private boolean ignoreNotFound;	public ManyToOne(Table table) {		super(table);	}	public Type getType() throws MappingException {		return TypeFactory.manyToOne( 			getReferencedEntityName(), 			getReferencedPropertyName(),			isEmbedded(), 			isIgnoreNotFound() );	}	public void createForeignKey() throws MappingException {		// TODO: handle the case of a foreign key to something other than the pk		if (referencedPropertyName==null && !hasFormula() ) {			createForeignKeyOfEntity( ( (EntityType) getType() ).getAssociatedEntityName() );		}	}	public Object accept(ValueVisitor visitor) {		return visitor.accept(this);	}	public boolean isIgnoreNotFound() {		return ignoreNotFound;	}	public void setIgnoreNotFound(boolean ignoreNotFound) {		this.ignoreNotFound = ignoreNotFound;	}	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?