本文整理汇总了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;
}
示例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++;
}
}
}
}
示例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;
}
示例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;
}
示例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() );
}
}
}
示例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;
}
示例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;
}
示例8: getId
import org.hibernate.annotations.Type; //导入依赖的package包/类
@Id
@Type(type = "uuid-char")
@Access(value = AccessType.PROPERTY)
@Override
public UUID getId() {
return id;
}
示例9: getLink
import org.hibernate.annotations.Type; //导入依赖的package包/类
@Override
@Type(type="text")
@Column(unique=true)
public String getLink()
{
return this.link;
}
示例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;
}
示例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;
}
示例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();
}
示例13: getDocument
import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type="org.hibernate.type.StringClobType")
@Override
public String getDocument() {
return super.getDocument();
}
示例14: getSetup
import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type = "org.hibernate.type.StringClobType")
@Override
public String getSetup() {
return super.getSetup();
}
示例15: getAction
import org.hibernate.annotations.Type; //导入依赖的package包/类
@Lob
@Column
@Type(type = "org.hibernate.type.StringClobType")
@Override
public String getAction() {
return super.getAction();
}