/**
  * Checks whether the passed in operation is a query and should be using named parameters.
  *
  * @param operation the operation.
  * @param defaultUseNamedParameters the default value.
  * @return whether named parameters should be used.
  */
 static boolean getUseNamedParameters(
     OperationFacade operation, boolean defaultUseNamedParameters) {
   ExceptionUtils.checkNull("operation", operation);
   boolean useNamedParameters = defaultUseNamedParameters;
   if (operation.isQuery()) {
     String useNamedParametersValue =
         StringUtils.trimToEmpty(
             (String)
                 operation.findTaggedValue(
                     SpringProfile.TAGGEDVALUE_HIBERNATE_USE_NAMED_PARAMETERS));
     if (StringUtils.isNotBlank(useNamedParametersValue)) {
       useNamedParameters = Boolean.valueOf(useNamedParametersValue).booleanValue();
     }
   }
   return useNamedParameters;
 }
Esempio n. 2
0
  /**
   * @see org.andromda.cartridges.jbpm.metafacades.JBpmActionLogic#handleGetClazz()
   * @see org.andromda.cartridges.jbpm.metafacades.JBpmAction#getClazz()
   */
  protected String handleGetClazz() {
    String clazz = null;
    if (this.isAssignment() || this.isTimer()) {
      final OperationFacade handler = this.getOperation();

      if (handler instanceof JBpmHandler) {
        final StringBuilder clazzBuffer = new StringBuilder();
        final String packageName = handler.getOwner().getPackageName();
        clazzBuffer.append(packageName);
        if (StringUtils.isNotBlank(packageName)) {
          clazzBuffer.append('.');
        }
        clazzBuffer.append(((JBpmHandler) handler).getHandlerClassName());
        clazz = clazzBuffer.toString();
      }
    }

    return clazz;
  }