类javax.persistence.ConstraintMode源码实例Demo

下面列出了怎么用javax.persistence.ConstraintMode的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: EntityBinder.java
private void setFKNameIfDefined(Join join) {
	// just awful..

	org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
	if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
		( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
	}
	else {
		javax.persistence.SecondaryTable jpaSecondaryTable = findMatchingSecondaryTable( join );
		if ( jpaSecondaryTable != null ) {
			if ( jpaSecondaryTable.foreignKey().value() == ConstraintMode.NO_CONSTRAINT ) {
				( (SimpleValue) join.getKey() ).setForeignKeyName( "none" );
			}
			else {
				( (SimpleValue) join.getKey() ).setForeignKeyName( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().name() ) );
				( (SimpleValue) join.getKey() ).setForeignKeyDefinition( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().foreignKeyDefinition() ) );
			}
		}
	}
}
 
源代码2 项目: requery   文件: JoinTableAssociation.java
private ReferentialAction mapConstraint(ConstraintMode constraint) {
    switch (constraint) {
        case NO_CONSTRAINT:
            return ReferentialAction.NO_ACTION;
        default:
        case CONSTRAINT:
        case PROVIDER_DEFAULT:
            return ReferentialAction.CASCADE;
    }
}
 
源代码3 项目: scheduling   文件: TaskData.java
@Cascade(org.hibernate.annotations.CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "ENV_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getEnvScript() {
    return envScript;
}
 
源代码4 项目: scheduling   文件: TaskData.java
@Cascade(org.hibernate.annotations.CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getScript() {
    return script;
}
 
源代码5 项目: scheduling   文件: TaskData.java
@Cascade(CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "PRE_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getPreScript() {
    return preScript;
}
 
源代码6 项目: scheduling   文件: TaskData.java
@Cascade(CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "POST_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getPostScript() {
    return postScript;
}
 
源代码7 项目: scheduling   文件: TaskData.java
@Cascade(CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "CLEAN_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getCleanScript() {
    return cleanScript;
}
 
源代码8 项目: scheduling   文件: TaskData.java
@Cascade(CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY)
// disable foreign key, to be able to remove runtime data
@JoinColumn(name = "FLOW_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
public ScriptData getFlowScript() {
    return flowScript;
}
 
 类所在包
 类方法
 同包方法