当前位置: 首页>>代码示例>>Java>>正文


Java Type类代码示例

本文整理汇总了Java中org.hibernate.annotations.Type的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Type类属于org.hibernate.annotations包,在下文中一共展示了Type类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPid

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Id
@Column(name="PID",length=15)
@Type(type="int")
@GenericGenerator(name="gen",strategy="increment")
@GeneratedValue(generator="gen")
	public int getPid() {
		return pid;
	}
 
开发者ID:pratikdimble,项目名称:Hibernate_Component_Mapping_Using_DAO_Using_Maven,代码行数:9,代码来源:person.java

示例2: checkEnumMapping

import org.hibernate.annotations.Type; //导入依赖的package包/类
/**
 * Enums must be mapped as String, not ORDINAL.
 * @param g
 */
private void checkEnumMapping(Method g) {
	if(Enum.class.isAssignableFrom(g.getReturnType())) {		// Is type enum?
		if(g.getAnnotation(Transient.class) != null)
			return;

		//-- If the enum has a @Type we will have to assume the type handles mapping correctly (like MappedEnumType)
		org.hibernate.annotations.Type ht = g.getAnnotation(Type.class);
		if(null == ht) {
			//-- No @Type mapping, so this must have proper @Enumerated definition.
			Enumerated e = g.getAnnotation(Enumerated.class);
			if(null == e) {
				problem(Severity.ERROR, "Missing @Enumerated annotation on enum property - this will cause ORDINAL mapping of an enum which is undesirable");
				m_enumErrors++;
			} else if(e.value() != EnumType.STRING) {
				problem(Severity.ERROR, "@Enumerated(ORDINAL) annotation on enum property - this will cause ORDINAL mapping of an enum which is undesirable");
				m_enumErrors++;
			}
		}
	}
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:25,代码来源:HibernateChecker.java

示例3: getNames

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Type(type = "org.openyu.commons.entity.usertype.NamesEntityUserType")
@Column(name = "names", length = 2048)
@Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = NamesEntityBridge.class)
public Set<LocaleNameEntity> getNames() {
	return names;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:8,代码来源:DogPoImpl.java

示例4: discoverTypeWithoutReflection

import org.hibernate.annotations.Type; //导入依赖的package包/类
private static boolean discoverTypeWithoutReflection(XProperty p) {
	if ( p.isAnnotationPresent( OneToOne.class ) && !p.getAnnotation( OneToOne.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( OneToMany.class ) && !p.getAnnotation( OneToMany.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToOne.class ) && !p.getAnnotation( ManyToOne.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToMany.class ) && !p.getAnnotation( ManyToMany.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToAny.class ) ) {
		if ( !p.isCollection() && !p.isArray() ) {
			throw new AnnotationException( "@ManyToAny used on a non collection non array property: " + p.getName() );
		}
		return true;
	}
	else if ( p.isAnnotationPresent( Type.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( Target.class ) ) {
		return true;
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:PropertyContainer.java

示例5: setExplicitType

import org.hibernate.annotations.Type; //导入依赖的package包/类
public void setExplicitType(Type typeAnn) {
	if ( typeAnn != null ) {
		explicitType = typeAnn.type();
		typeParameters.clear();
		for ( Parameter param : typeAnn.parameters() ) {
			typeParameters.setProperty( param.name(), param.value() );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:SimpleValueBinder.java

示例6: getName

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Column(length=15)
@Type(type="string")
@NotNull(message="Name is Required")
@Size(min=4,max=10,message="Name Must be in 5 to 10 chars only")
@Pattern(regexp="ps[A-Z]*",message="Name Must be Starts with ps")
public String getName() {
	return name;
}
 
开发者ID:pratikdimble,项目名称:Hibernate_Validation_API_Annotation_Simple,代码行数:9,代码来源:Employee.java

示例7: getId

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Override
@Id
@Type(type = "uuid-char")
@Access(value = AccessType.PROPERTY)
@Column(name = "file_metadata_uuid", nullable = false, updatable = false)
public UUID getId() {
    return id;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:PersistentFileMetadata.java

示例8: getId

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Id
@Type(type = "uuid-char")
@Access(value = AccessType.PROPERTY)
@Override
public UUID getId() {
    return id;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:8,代码来源:PersistentFileContent.java

示例9: getLink

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Override
@Type(type="text")
@Column(unique=true)
public String getLink()
{
    return this.link;
}
 
开发者ID:MadCoderZ,项目名称:NewsBotIRC,代码行数:8,代码来源:DBEntry.java

示例10: getDob

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Type(type="org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime")
@Basic( optional = true )
@Column
@ColumnTransformer(
		read="convert_from(dob_decrypt(dob),'UTF-8')",
		write="dob_encrypt(?)")
public LocalDateTime getDob() {
	return this.dob;

}
 
开发者ID:hserv,项目名称:coordinated-entry,代码行数:11,代码来源:Client.java

示例11: getId

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Id
  @Basic( optional = false )
  @Column( name = "id", nullable = false  ) @org.hibernate.annotations.Type(type="org.hibernate.type.PostgresUUIDType")
public java.util.UUID getId() {
	return this.id;

}
 
开发者ID:hserv,项目名称:coordinated-entry,代码行数:8,代码来源:Client.java

示例12: getContent

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column(nullable = false)
@Type(type = "org.hibernate.type.MaterializedBlobType")
@Override
public byte[] getContent() {
	return super.getContent();
}
 
开发者ID:LeonanCarvalho,项目名称:testcube-server,代码行数:8,代码来源:PlanAttachment.java

示例13: getDocument

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type="org.hibernate.type.StringClobType")
@Override
public String getDocument() {
	return super.getDocument();
}
 
开发者ID:LeonanCarvalho,项目名称:testcube-server,代码行数:8,代码来源:TestPlan.java

示例14: getSetup

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type = "org.hibernate.type.StringClobType")
@Override
public String getSetup() {
	return super.getSetup();
}
 
开发者ID:LeonanCarvalho,项目名称:testcube-server,代码行数:8,代码来源:TestCase.java

示例15: getAction

import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type = "org.hibernate.type.StringClobType")
@Override
public String getAction() {
	return super.getAction();
}
 
开发者ID:LeonanCarvalho,项目名称:testcube-server,代码行数:8,代码来源:TestCase.java


注:本文中的org.hibernate.annotations.Type类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。