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


Java Lob类代码示例

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


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

示例1: stringFieldsMustHaveExplicitAndConsistentLengthDefinition

import javax.persistence.Lob; //导入依赖的package包/类
@Test
public void stringFieldsMustHaveExplicitAndConsistentLengthDefinition() {
    final Stream<Field> failedFields = filterFieldsOfManagedJpaTypes(field -> {
        final int modifiers = field.getModifiers();

        if (String.class.isAssignableFrom(field.getType()) &&
                !Modifier.isStatic(modifiers) &&
                !Modifier.isTransient(modifiers) &&
                !field.isAnnotationPresent(Transient.class) &&
                !field.isAnnotationPresent(Lob.class)) {

            final Column column = field.getAnnotation(Column.class);
            final Size size = field.getAnnotation(Size.class);

            return column == null && !hasIdGetter(field) ||
                    column != null && size != null && column.length() != size.max();
        }

        return false;
    });

    assertNoFields(failedFields,
            "These entity fields should be explicitly annotated with @Column and @Size with consistency on " +
                    "field's maximum length: ");
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:26,代码来源:JpaModelTest.java

示例2: buildForm

import javax.persistence.Lob; //导入依赖的package包/类
protected void buildForm(SimpleFormBuilder form, List<PropertyDescriptor> descriptors) {
	for(PropertyDescriptor pds : descriptors) {
		if ("class".equals(pds.getName())) continue; // skip the class property
		else if (Collection.class.isAssignableFrom(pds.getPropertyType())) {
			addListFor(pds);
		}
		else if (pds.getReadMethod().isAnnotationPresent(Lob.class)) {
			TextArea area = new TextArea();
			area.setPrefRowCount(10);
			addRight(BeanUtils.getDisplayName(pds), area);
			addToNamespace(pds.getName(), area);				
		}
		else {
			Row row = form.row();
			row.apply(r -> addFieldFor(r, pds));
			HBox spring = new HBox();
			spring.setPrefSize(0, 0);
			spring.setMinSize(0, 0);
			spring.setMaxSize(Double.MAX_VALUE, 0);
			
			row.fieldNode(spring);
			row.hGrow(Priority.SOMETIMES);
			row.end();
		}
	}
}
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:27,代码来源:PojoForm.java

示例3: isSortable

import javax.persistence.Lob; //导入依赖的package包/类
@Override
public Optional<Boolean> isSortable(BeanAttributeInformation attributeDesc) {
	Optional<Lob> lob = attributeDesc.getAnnotation(Lob.class);
	if (lob.isPresent()) {
		return Optional.of(false);
	}
	return Optional.empty();
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:9,代码来源:JpaResourceFieldInformationProvider.java

示例4: isFilterable

import javax.persistence.Lob; //导入依赖的package包/类
@Override
public Optional<Boolean> isFilterable(BeanAttributeInformation attributeDesc) {
	Optional<Lob> lob = attributeDesc.getAnnotation(Lob.class);
	if (lob.isPresent()) {
		return Optional.of(false);
	}
	return Optional.empty();
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:9,代码来源:JpaResourceFieldInformationProvider.java

示例5: getData

import javax.persistence.Lob; //导入依赖的package包/类
/**
 * Remove the following line completely (Type Annotation) in case of database other than PostGres and Uncomment the
 * annotation for @Lob
 */
// @Type(type = "org.hibernate.type.BinaryType")
@Lob
public Blob getData() {

  return this.data;
}
 
开发者ID:oasp,项目名称:oasp-tutorial-sources,代码行数:11,代码来源:BinaryObjectEntity.java

示例6: doFields

import javax.persistence.Lob; //导入依赖的package包/类
public void doFields(SimpleFormBuilder form, int colCount, String[] names) {
	int col = 0;
	Row row = null;
	for (String name : names) {
		PropertyDescriptor p = BeanUtils.getProperty(getBeanInfo(), name);
		if (p == null) {
			log.log(Level.WARNING, "Unable to find property {0}", name);
			continue;
		}
		else if (List.class.isAssignableFrom(p.getPropertyType())) {
			addListFor(p);
		}
		else if (p.getReadMethod().isAnnotationPresent(Lob.class)) {
			TextArea area = new TextArea();
			area.setPrefRowCount(10);
			addRight(BeanUtils.getDisplayName(p), area);
			addToNamespace(p.getName(), area);				
		}
		else {
			if (row == null) {
				row = form.row();
				col = 0;
			}
			row.apply(r -> addFieldFor(r, p));
			col ++;
			if (col >= colCount) {
				row.end();
				row = null;
			}
		}
	}
	if (row != null) {
		row.end();
	}
}
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:36,代码来源:MyWMSForm.java

示例7: getContent

import javax.persistence.Lob; //导入依赖的package包/类
/**
 * 获取内容
 * 
 * @return 内容
 */
@NotEmpty
@Lob
@Column(nullable = false)
public String getContent() {
	return content;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:12,代码来源:DeliveryTemplate.java

示例8: getTemplate

import javax.persistence.Lob; //导入依赖的package包/类
/**
 * 获取模板
 * 
 * @return 模板
 */
@NotEmpty
@Lob
@Column(nullable = false)
public String getTemplate() {
	return template;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:12,代码来源:AdPosition.java

示例9: getDescription

import javax.persistence.Lob; //导入依赖的package包/类
@Override
@Column(name = SQLNameConstants.DESCRIPTION)
@Lob
public String getDescription() {
    return description;
}
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:7,代码来源:StroomStatsStoreEntity.java

示例10: getData

import javax.persistence.Lob; //导入依赖的package包/类
@Lob
@Column(name = SQLNameConstants.DATA, length = Integer.MAX_VALUE)
@ExternalFile
public String getData() {
    return data;
}
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:7,代码来源:StroomStatsStoreEntity.java

示例11: getText

import javax.persistence.Lob; //导入依赖的package包/类
@Lob
public String getText()
{
	return text;
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:LanguageString.java

示例12: getRoot

import javax.persistence.Lob; //导入依赖的package包/类
@Lob
public WorkflowTreeNode getRoot()
{
	return root;
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:Workflow.java

示例13: getLob

import javax.persistence.Lob; //导入依赖的package包/类
private void getLob(List<Annotation> annotationList, Element element) {
	Element subElement = element != null ? element.element( "lob" ) : null;
	if ( subElement != null ) {
		annotationList.add( AnnotationFactory.create( new AnnotationDescriptor( Lob.class ) ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:JPAOverriddenAnnotationReader.java

示例14: makeProperty

import javax.persistence.Lob; //导入依赖的package包/类
public Property makeProperty() {
	validateMake();
	LOG.debugf( "Building property %s", name );
	Property prop = new Property();
	prop.setName( name );
	prop.setNodeName( name );
	prop.setValue( value );
	prop.setLazy( lazy );
	prop.setCascade( cascade );
	prop.setPropertyAccessorName( accessType.getType() );

	if ( property != null ) {
		prop.setValueGenerationStrategy( determineValueGenerationStrategy( property ) );
	}

	NaturalId naturalId = property != null ? property.getAnnotation( NaturalId.class ) : null;
	if ( naturalId != null ) {
		if ( ! entityBinder.isRootEntity() ) {
			throw new AnnotationException( "@NaturalId only valid on root entity (or its @MappedSuperclasses)" );
		}
		if ( ! naturalId.mutable() ) {
			updatable = false;
		}
		prop.setNaturalIdentifier( true );
	}

	// HHH-4635 -- needed for dialect-specific property ordering
	Lob lob = property != null ? property.getAnnotation( Lob.class ) : null;
	prop.setLob( lob != null );

	prop.setInsertable( insertable );
	prop.setUpdateable( updatable );

	// this is already handled for collections in CollectionBinder...
	if ( Collection.class.isInstance( value ) ) {
		prop.setOptimisticLocked( ( (Collection) value ).isOptimisticLocked() );
	}
	else {
		final OptimisticLock lockAnn = property != null
				? property.getAnnotation( OptimisticLock.class )
				: null;
		if ( lockAnn != null ) {
			//TODO this should go to the core as a mapping validation checking
			if ( lockAnn.excluded() && (
					property.isAnnotationPresent( javax.persistence.Version.class )
							|| property.isAnnotationPresent( Id.class )
							|| property.isAnnotationPresent( EmbeddedId.class ) ) ) {
				throw new AnnotationException(
						"@OptimisticLock.exclude=true incompatible with @Id, @EmbeddedId and @Version: "
								+ StringHelper.qualify( holder.getPath(), name )
				);
			}
		}
		final boolean isOwnedValue = !isToOneValue( value ) || insertable; // && updatable as well???
		final boolean includeInOptimisticLockChecks = ( lockAnn != null )
				? ! lockAnn.excluded()
				: isOwnedValue;
		prop.setOptimisticLocked( includeInOptimisticLockChecks );
	}

	LOG.tracev( "Cascading {0} with {1}", name, cascade );
	this.mappingProperty = prop;
	return prop;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:65,代码来源:PropertyBinder.java

示例15: getContent

import javax.persistence.Lob; //导入依赖的package包/类
@Lob
public String getContent() {
	return content;
}
 
开发者ID:xujeff,项目名称:tianti,代码行数:5,代码来源:Article.java


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