Skip to content
Philippe Marschall edited this page Dec 23, 2016 · 15 revisions

SQL Arrays are supported both as input and output parameters.

== Input ==

If a method parameter is either either Collection subtype or primitive or reference array we automatically map it to a SQL array. In order to create the array we need to know the name of the element type (see Connection#createArrayOf). We will call Array#free after the call.

For cases where this does not work for you you can either use the @TypeName annotation or implement the TypeNameResolver interface. For Collection subtype we recommend annotation the type parameter but annotating the parameter works as well.

  @ReturnValue
  String sampleArrayArgumentTypeParameter(List<@TypeName("name-of-array-element-type") Integer> ids);

  @ReturnValue
  String sampleArrayArgumentArray(@TypeName("name-of-array-element-type") Integer[] ids);

== Output ==

== Oracle ==

Arrays in Oracle are special because Oracle does not support anonymous arrays, Oracle only supports arrays as user defined types with a name.

Clone this wiki locally