Clob

Represents a character large object.

Conceptually you can consider it as a set of characters (an RTF or XML document, for example), though in fact it wraps three pieces of information:

  • the set of characters

  • a name

  • a mime type

API

Clob.java
class Clob {
  Clob(String name, String primaryType, String subType, char[] chars)
  Clob(String name, String mimeTypeBase, char[] chars)
  Clob(String name, MimeType mimeType, char[] chars)
  Clob(String name, String primaryType, String subType, CharSequence chars)
  Clob(String name, String mimeTypeBase, CharSequence chars)
  Clob(String name, MimeType mimeType, CharSequence chars)
  Clob of(String name, CommonMimeType mimeType, CharSequence content)     (1)
  String getName()
  MimeType getMimeType()
  CharSequence getChars()
  void writeCharsTo(final Writer wr)
  boolean equals(final Object o)
  int hashCode()
  String toString()
}
1 of(String, CommonMimeType, CharSequence)

Returns a new Clob of given name , mimeType and content .

Members

of(String, CommonMimeType, CharSequence)

Returns a new Clob of given name , mimeType and content .

name may or may not include the desired filename extension, it is guaranteed, that the resulting Clob has the appropriate extension as constraint by the given mimeType .

For more fine-grained control use one of the Clob constructors directly.

Usage Notes

If using JDO/DataNucleus, Clob properties can be mapped using:

@javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
        @javax.jdo.annotations.Column(name = "doc_name"),
        @javax.jdo.annotations.Column(name = "doc_mimetype"),
        @javax.jdo.annotations.Column(name = "doc_chars", jdbcType = "CLOB", sqlType = "CLOB")
})
@Property( optionality = Optionality.OPTIONAL )
@Getter @Setter
private Clob doc;

If the property is mandatory, add allowsNull = "false for each of the @Columns.