Packages

sealed trait LengthLimitedString extends NoCopy

This trait wraps a String that is limited to a certain maximum length. Classes implementing this trait expose create and tryCreate methods to safely (and non-safely) construct such a String.

The canonical use case for LengthLimitedString's is ensuring that we don't write too long strings into the database: Oracle has a length-limit of 1000 Unicode characters for the ordinary String type NVARCHAR2 and we are trying to avoid the use of CLOB (as it has pitfalls regarding implicits). This validation generally occurs on the server side and not on the client side. Concretely, this means that the Admin API and Ledger API gRPC services is the point where we validate that the received Protobuf Strings are not too long (and convert them into LengthLimitedStrings). On the client side, e.g. at the console, we generally take normal String types. The console command set_display_name and service GrpcPartyNameManagementService validating request.displayName illustrate this.

As a rule of thumb: whenever you want to create a column that uses a NVARCHAR2 in Oracle, the value you write to it should use a LengthLimitedString.

Some more background on the Oracle issues: NVARCHAR and NVARCHAR2 have both by default a 4000 byte limit, but unicode uses 4-bytes per character (and nvarchar2 uses unicode) Therefore, NVARCHAR has a limit of 4000 and NVARCHAR2 has a limit of 1000 characters If need be, we can extend this to 32 KB by setting the Oracle database string size to 'extended mode' (ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED)

CLOB is only used for the following values (none are indices): - V1_1 source_description - v4 agreement_text - v8 ignore_reason - v13 connection_uri - v28_1 error_message

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LengthLimitedString
  2. NoCopy
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def maxLength: Int
  2. abstract def str: String

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def canEqual(a: Any): Boolean
    Annotations
    @SuppressWarnings()
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def copy(nothing: Nothing): Nothing
    Attributes
    protected
    Definition Classes
    NoCopy
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(that: Any): Boolean
    Definition Classes
    LengthLimitedString → AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    LengthLimitedString → AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def name: Option[String]
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toProtoPrimitive: String
  19. def toString(): String
    Definition Classes
    LengthLimitedString → AnyRef → Any
  20. def tryConcatenate(that: String): LengthLimitedStringVar
  21. def tryConcatenate(that: LengthLimitedString): LengthLimitedStringVar
  22. def unwrap: String
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from NoCopy

Inherited from AnyRef

Inherited from Any

Ungrouped