javax.persistence.Lob Java Examples

The following examples show how to use javax.persistence.Lob. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractCellPostParser.java    From bdf3 with Apache License 2.0 6 votes vote down vote up
@Override
public void parse(Context context) {
	if (context.getValue() != null) {
		MappingRule mappingRule =context.getCurrentMappingRule();
		BeanMap beanMap = BeanMap.create(context.getCurrentEntity());
		if (context.getValue() != Constants.IGNORE_ERROR_FORMAT_DATA) {
			Field field = ReflectionUtils.findField(context.getEntityClass(), mappingRule.getPropertyName());
			Column column = field.getAnnotation(Column.class);
			if (column.nullable()) {
				if (context.getValue() == null) {
					throw new DataNullableException(context.getCurrentCell().getRow(), context.getCurrentCell().getCol());
				}
			}
			
			if (field.getType() == String.class && !field.isAnnotationPresent(Lob.class)) {
				String value = (String) context.getValue();
				if (value.getBytes().length > column.length()) {
					throw new DataLengthException(context.getCurrentCell().getRow(), context.getCurrentCell().getCol(), value, column.length());
				}
			}
			beanMap.put(mappingRule.getPropertyName(), context.getValue());
		}
	}
}
 
Example #2
Source File: JpaResourceFieldInformationProvider.java    From crnk-framework with Apache License 2.0 5 votes vote down vote up
@Override
public Optional<Boolean> isFilterable(BeanAttributeInformation attributeDesc) {
    Optional<Lob> lob = attributeDesc.getAnnotation(Lob.class);
    if (lob.isPresent()) {
        return Optional.of(false);
    }
    return Optional.empty();
}
 
Example #3
Source File: NodeMonitoring.java    From ankush with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @return the graphView
 */
@JsonIgnore
@Lob
@Column(length = Integer.MAX_VALUE - 1)
public byte[] getGraphView() {
	return graphView;
}
 
Example #4
Source File: NodeMonitoring.java    From ankush with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @return the technologyServiceBytes
 */
@JsonIgnore
@Lob
@Column(length = Integer.MAX_VALUE - 1)
public byte[] getTechnologyServiceBytes() {
	return technologyServiceBytes;
}
 
Example #5
Source File: JeecgDemoCkfinderEntity.java    From jeewx with Apache License 2.0 5 votes vote down vote up
/**
 * 方法: 取得java.lang.Object
 * 
 * @return: java.lang.Object 备注
 */
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "REMARK", nullable = true)
public java.lang.String getRemark() {
	return this.remark;
}
 
Example #6
Source File: MybatisPersistentPropertyImpl.java    From spring-data-mybatis with Apache License 2.0 5 votes vote down vote up
@Override
public JdbcType getJdbcType() {

	if (isAnnotationPresent(
			org.springframework.data.mybatis.annotation.JdbcType.class)) {
		return JdbcType.valueOf(getRequiredAnnotation(
				org.springframework.data.mybatis.annotation.JdbcType.class).value());
	}

	if (isAnnotationPresent(Temporal.class)) {
		Temporal temporal = getRequiredAnnotation(Temporal.class);
		switch (temporal.value()) {

		case DATE:
			return DATE;
		case TIME:
			return TIME;
		case TIMESTAMP:
			return TIMESTAMP;
		}
	}

	Class<?> actualType = getActualType();

	if (isAnnotationPresent(Lob.class)) {
		if (actualType == String.class) {
			return CLOB;
		}
		return BLOB;
	}

	JdbcType jdbcType = JAVA_MAPPED_TO_JDBC_TYPES.get(actualType);

	return null == jdbcType ? UNDEFINED : jdbcType;
}
 
Example #7
Source File: BinaryObjectEntity.java    From jump-the-queue with Apache License 2.0 5 votes vote down vote up
/**
 * @return the {@link Blob} data.
 */
@Lob
@Column(name = "content")
public Blob getData() {

  return this.data;
}
 
Example #8
Source File: CommitteeProposalData.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
* Gets the ballot summary item.
*
* @return the ballot summary item
*/
  @Basic
  @Column(name = "BALLOT_SUMMARY_ITEM")
  @Lob
  public String getBallotSummaryItem() {
      return XmlAdapterUtils.unmarshall(ElementAsString.class, this.getBallotSummary());
  }
 
Example #9
Source File: JPATypeConverter.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
private static boolean isBlob(final Attribute<?, ?> currentAttribute) {
  if (currentAttribute != null) {
    AnnotatedElement annotatedElement = (AnnotatedElement) currentAttribute.getJavaMember();
    if (annotatedElement != null && annotatedElement.getAnnotation(Lob.class) != null) {
      return true;
    }
  }
  return false;
}
 
Example #10
Source File: JPATypeConverterTest.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public <T extends Annotation> T getAnnotation(final Class<T> annotationClass) {

  if (testCase.equals("temporalnull")) {
    return null;
  }

  if (annotationClass.equals(Temporal.class)) {
    if (temporal == null) {
      temporal = EasyMock.createMock(Temporal.class);
      if (testCase.equals("datetime")) {
        EasyMock.expect(temporal.value()).andReturn(TemporalType.TIMESTAMP).anyTimes();
        EasyMock.replay(temporal);
      } else if (testCase.equals("time")) {
        EasyMock.expect(temporal.value()).andReturn(TemporalType.TIME).anyTimes();
        EasyMock.replay(temporal);
      }
    }
    return (T) temporal;
  } else if (annotationClass.equals(Lob.class)) {
    if (testCase.equals("lob")) {
      lob = EasyMock.createMock(Lob.class);
      EasyMock.replay(lob);
    }
    return (T) lob;
  }
  return null;

}
 
Example #11
Source File: DynamicEntityBuilder.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
private void createStringLobField(Builder builder, Field field) {

//		public static final String stringLobValue_FIELDNAME = "stringLobValue";
//		@FieldDescribe("长文本.")
//		@Lob
//		@Basic(fetch = FetchType.EAGER)
//		@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + stringLobValue_FIELDNAME)

		AnnotationSpec lob = AnnotationSpec.builder(Lob.class).build();

		AnnotationSpec basic = AnnotationSpec.builder(Basic.class)
				.addMember("fetch", "javax.persistence.FetchType.EAGER").build();

		AnnotationSpec column = AnnotationSpec.builder(Column.class).addMember("length", "length_100M")
				.addMember("name", "ColumnNamePrefix + " + field.fieldName()).build();

		FieldSpec fieldSpec = FieldSpec.builder(String.class, field.getName(), Modifier.PRIVATE)
				.addAnnotation(this.fieldDescribe(field)).addAnnotation(lob).addAnnotation(basic).addAnnotation(column)
				.build();
		MethodSpec get = MethodSpec.methodBuilder("get" + StringUtils.capitalize(field.getName()))
				.addModifiers(Modifier.PUBLIC).returns(String.class).addStatement("return this." + field.getName())
				.build();
		MethodSpec set = MethodSpec.methodBuilder("set" + StringUtils.capitalize(field.getName()))
				.addModifiers(Modifier.PUBLIC).returns(void.class).addParameter(String.class, field.getName())
				.addStatement("this." + field.getName() + " = " + field.getName()).build();
		builder.addField(this.fieldName(field)).addField(fieldSpec).addMethod(get).addMethod(set);

	}
 
Example #12
Source File: CheckCore.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void checkLobIndex(List<Class<?>> classes) throws Exception {
	for (Class<?> cls : classes) {
		List<Field> fields = FieldUtils.getAllFieldsList(cls);
		for (Field field : fields) {
			Lob lob = field.getAnnotation(Lob.class);
			Index index = field.getAnnotation(Index.class);
			if ((null != lob) && (null != index)) {
				System.err.println(String.format("checkLobIndex error: class: %s, field: %s.", cls.getName(),
						field.getName()));
			}
		}
	}
}
 
Example #13
Source File: Template.java    From ankush with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @return the dataBytes
 */
@JsonIgnore
@Lob
@Column(length = Integer.MAX_VALUE - 1)
public byte[] getDataBytes() {
	return dataBytes;
}
 
Example #14
Source File: FdContent.java    From mPaaS with Apache License 2.0 5 votes vote down vote up
/**
 * 读-文档内容
 *
 * @return
 */
@Column
@Lob
@MetaProperty(messageKey = "property.fdContent")
default String getFdContent() {
    return (String) getExtendProps().get("fdContent");
}
 
Example #15
Source File: KeyDataValue.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(name="key_data_value_string", length = 65636)
public String getKeyDataValueString() {
    return keyDataValueString;
}
 
Example #16
Source File: Cluster.java    From ankush with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Gets the conf bytes.
 * 
 * @return the confBytes
 */
@Lob
@Column(length = Integer.MAX_VALUE - 1)
private byte[] getConfBytes() {
	return confBytes;
}
 
Example #17
Source File: Reference.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(name="digest_value", length = 65636)
public byte[] getDigestValue() {
    return digestValue;
}
 
Example #18
Source File: TmodelInstanceInfo.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(name = "instance_parms", length = 8192)
public String getInstanceParms() {
	return this.instanceParms;
}
 
Example #19
Source File: KeyDataValue.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(name="key_data_value", length = 65636)
public byte[] getKeyDataValueBytes() {
    return keyDataValueBytes;
}
 
Example #20
Source File: SignatureTransformDataValue.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(name="content_bytes", length = 65636)
public byte[] getContentBytes() {
    return contentBytes;
}
 
Example #21
Source File: Cluster.java    From ankush with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Gets the an conf bytes.
 * 
 * @return the anConfBytes
 */
@Lob
@Column(length = Integer.MAX_VALUE - 1)
private byte[] getAnConfBytes() {
	return anConfBytes;
}
 
Example #22
Source File: NodeMonitoring.java    From ankush with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Gets the technology data bytes.
 * 
 * @return the technologyDataBytes
 */
@Lob
@Column(length = Integer.MAX_VALUE - 1)
private byte[] getTechnologyDataBytes() {
	return technologyDataBytes;
}
 
Example #23
Source File: ObjectTypeContent.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Lob
@Column(length = 65636)
public byte[] getContent() {
    return content;
}
 
Example #24
Source File: SignatureValue.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Column(name="value_bytes", length = 65636)
@Lob
public byte[] getValue() {
    return value;
}
 
Example #25
Source File: ChangeRecord.java    From juddi with Apache License 2.0 4 votes vote down vote up
@Column(name = "change_contents")
@Lob
public byte[] getContents() {
        return contents;
}
 
Example #26
Source File: Snippet.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@Lob
@Column(nullable = false)
public String getValue() {
	return value;
}
 
Example #27
Source File: Article.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@Lob
@Column(nullable = false)
public String getContent() {
	return content;
}
 
Example #28
Source File: ImportJob.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@Lob
public String getError() {
    return error;
}
 
Example #29
Source File: ImportItem.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@Lob
public String getTags() {
    return tags;
}
 
Example #30
Source File: ImportItem.java    From website with GNU Affero General Public License v3.0 4 votes vote down vote up
@Lob
public String getDisallowedCountries() {
    return disallowedCountries;
}