org.apache.cayenne.velocity.VelocitySQLTemplateProcessor.class Maven / Gradle / Ivy
???? 7 ?
java/lang/Object ()V 5org/apache/cayenne/template/SQLTemplateRenderingUtils
8org/apache/cayenne/velocity/VelocitySQLTemplateProcessor renderingUtils 7Lorg/apache/cayenne/template/SQLTemplateRenderingUtils; +org/apache/velocity/runtime/RuntimeInstance
velocityRuntime -Lorg/apache/velocity/runtime/RuntimeInstance;
userdirective )org/apache/cayenne/velocity/BindDirective
java/lang/Class getName ()Ljava/lang/String;
" # $ addProperty '(Ljava/lang/String;Ljava/lang/Object;)V & .org/apache/cayenne/velocity/BindEqualDirective ( 1org/apache/cayenne/velocity/BindNotEqualDirective * 4org/apache/cayenne/velocity/BindObjectEqualDirective , 7org/apache/cayenne/velocity/BindObjectNotEqualDirective . +org/apache/cayenne/velocity/ResultDirective 0 *org/apache/cayenne/velocity/ChainDirective 2 *org/apache/cayenne/velocity/ChunkDirective
4 5 init 7 java/lang/Exception 9 *org/apache/cayenne/CayenneRuntimeException ; *Error setting up Velocity RuntimeInstance.
8 = > =(Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V @ A B C D
java/util/Map isEmpty ()Z F java/util/HashMap
E H I (Ljava/util/Map;)V
E K L (I)V
N O P parse H(Ljava/lang/String;)Lorg/apache/velocity/runtime/parser/node/SimpleNode;
R S T processTemplate ?(Ljava/lang/String;Lorg/apache/velocity/runtime/parser/node/SimpleNode;Ljava/util/Map;)Lorg/apache/cayenne/access/jdbc/SQLStatement;
E W Norg/apache/cayenne/velocity/VelocitySQLTemplateProcessor$PositionalParamMapper
V Y Z \(Lorg/apache/cayenne/velocity/VelocitySQLTemplateProcessor;Ljava/util/List;Ljava/util/Map;)V
\ ] ^ _ ` 2org/apache/velocity/runtime/parser/node/SimpleNode jjtAccept ](Lorg/apache/velocity/runtime/parser/node/ParserVisitor;Ljava/lang/Object;)Ljava/lang/Object;
V b c onFinish e java/util/ArrayList
d h bindings @ j k l put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; n
resultColumns p helper r #org/apache/velocity/VelocityContext
q H
u v w buildStatement (Lorg/apache/velocity/VelocityContext;Ljava/lang/String;Lorg/apache/velocity/runtime/parser/node/SimpleNode;)Ljava/lang/String; y "Error processing Velocity template { | } ~ java/util/List size ()I ? 5org/apache/cayenne/access/translator/ParameterBinding { ? ? ? toArray (([Ljava/lang/Object;)[Ljava/lang/Object; ? /org/apache/cayenne/access/jdbc/ColumnDescriptor ? +org/apache/cayenne/access/jdbc/SQLStatement
? ? ? (Ljava/lang/String;[Lorg/apache/cayenne/access/jdbc/ColumnDescriptor;[Lorg/apache/cayenne/access/translator/ParameterBinding;)V ? 6org/apache/velocity/context/InternalContextAdapterImpl
? ? ? ((Lorg/apache/velocity/context/Context;)V
? ? ? ? pushCurrentTemplateName (Ljava/lang/String;)V ? java/io/StringWriter
? ? ? ? java/lang/String length
? K
\ ? 5 ? Z(Lorg/apache/velocity/context/InternalContextAdapter;Ljava/lang/Object;)Ljava/lang/Object;
\ ? ? ? render G(Lorg/apache/velocity/context/InternalContextAdapter;Ljava/io/Writer;)Z
? ? ? toString
? ? ? popCurrentTemplateName ? java/io/StringReader
? ? ? ? org/apache/velocity/Template
?
? O ? d(Ljava/io/Reader;Lorg/apache/velocity/Template;)Lorg/apache/velocity/runtime/parser/node/SimpleNode; ? 1org/apache/velocity/runtime/parser/ParseException ? Error parsing template '%s' : %s
? ? ?
getMessage
8 ? ? ((Ljava/lang/String;[Ljava/lang/Object;)V ? Error parsing template %s ? 3org/apache/cayenne/access/jdbc/SQLTemplateProcessor BINDINGS_LIST_KEY Ljava/lang/String;
ConstantValue RESULT_COLUMNS_LIST_KEY
HELPER_KEY Code LineNumberTable LocalVariableTable ex Ljava/lang/Exception; this :Lorg/apache/cayenne/velocity/VelocitySQLTemplateProcessor;
StackMapTable P(Ljava/lang/String;Ljava/util/Map;)Lorg/apache/cayenne/access/jdbc/SQLStatement; template
parameters Ljava/util/Map; internalParameters parsedTemplate 4Lorg/apache/velocity/runtime/parser/node/SimpleNode; LocalVariableTypeTable $Ljava/util/Map; 5Ljava/util/Map; Signature e(Ljava/lang/String;Ljava/util/Map;)Lorg/apache/cayenne/access/jdbc/SQLStatement; Q(Ljava/lang/String;Ljava/util/List;)Lorg/apache/cayenne/access/jdbc/SQLStatement; positionalParameters Ljava/util/List; visitor PLorg/apache/cayenne/velocity/VelocitySQLTemplateProcessor$PositionalParamMapper; $Ljava/util/List; e(Ljava/lang/String;Ljava/util/List;)Lorg/apache/cayenne/access/jdbc/SQLStatement; sql e results
bindingsArray 8[Lorg/apache/cayenne/access/translator/ParameterBinding; resultsArray 2[Lorg/apache/cayenne/access/jdbc/ColumnDescriptor; ILjava/util/List; CLjava/util/List; ?(Ljava/lang/String;Lorg/apache/velocity/runtime/parser/node/SimpleNode;Ljava/util/Map;)Lorg/apache/cayenne/access/jdbc/SQLStatement; context %Lorg/apache/velocity/VelocityContext; ica 8Lorg/apache/velocity/context/InternalContextAdapterImpl; out Ljava/io/StringWriter; ? java/lang/Throwable
Exceptions nodeTree pex 3Lorg/apache/velocity/runtime/parser/ParseException;
SourceFile !VelocitySQLTemplateProcessor.java NestMembers InnerClasses PositionalParamMapper ! ? ? ? ? g ? ? ? m ? ? ? o ? 3 ?*? *? Y? ?
*? Y? ? *? ? ? !*? %? ? !*? '? ? !*? )? ? !*? +? ? !*? -? ? !*? /? ? !*? 1? ? !*? ? 3? L? 8Y:+? ? ? ? ? ? 6 ? B c d e g ( h 6 i D j R k ` l n m | n ? p ? s ? q ? r ? u ? ? ? ? ? ? ? ? ? ? 6 S ? ? ? 1,? ,? ? ? ? EY,? G? ? EY? JN*+? M:*+-? Q? ? ? ? ! ? ( ? ? 4 1 ? ? 1 ? ? 1 ? ? ! ? ? ( ? ? ? 1 ? ? ! ? ? ? G @ ? ? S ? ? ? 2*+? MN? EY? U:? VY*,? X:-? [W? a*+-? Q? ? ? ? ? ? $ ? ) ? ? > 2 ? ? 2 ? ? 2 ? ? , ? ? # ? ? ? ? ? 2 ? ? # ? ? ? ? S T ? ? ?? dY? f:? dY? f:-g? i W-m? i W-o*?
? i W*? qY-? s+,? t:? :? 8Yx? ? ? z ? ?:? ? W? z ? ?:? ? W? ?Y? ?? 5 E H 6 ? : ? ? ? ? ( ? 5 ? E ? H ? J ? Z ? f ? p ? | ? ? ? ? p E ? ? J ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? h ? ? ? ? Z : ? ? f . ? ? | ? ? ? ? ? ? ? h ? ? ? ? ? $ ? H ? \ @ { { 6? ? ? ? v w ? ? J? ?Y+? ?:,? ?? ?Y,? ?? ?:-*? ? ?W-? ?W? ?:? ??:? ?? 8 @ @ B @ ? *
?
? ? ? ( ? 1 ? 8 ? = ? @ ? G ? ? > J ? ? J ? ? J ? ? J ? ?
@ ? ? - ? ? ? ? @ q ? \ ? ? ? ? 6 O P ? ? L*? ? ?Y+? ?? ?Y? ?? ?M? N? 8Y?? Y+SY-? ?S? ??,? ? 8Y?? Y+S? ??,? ? ? ? ? ? ? 4 ? 8 ? J ? ? 4 ? ? ? ? L ? ? L ? ? 4 ? ? ?
Z ?? \ ? ? ? V ?
V ?