Package org.apache.empire.commons

Examples of org.apache.empire.commons.Options


            addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(UPDATE_TIMESTAMP);

            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "Male");
            genders.set("F", "Female");
            GENDER.setOptions(genders);
        }
View Full Code Here


                {   // Print all field values
                    if (i>0)
                        System.out.print("\t");
                    // Check if conversion is necessary
                    DBColumnExpr c = reader.getColumnExpr(i);
                    Options opt = c.getOptions();
                    if (opt!=null)
                    {   // Option Lookup
                        System.out.print(opt.get(reader.getValue(i)));
                    }
                    else
                    {   // Print String
                        System.out.print(reader.getString(i));
                    }
View Full Code Here

                elem.setAttribute("size", String.valueOf(size));
            // add All Attributes
            if (attributes != null)
                attributes.addXml(elem, flags);
            // add All Options
            Options fieldOptions = getOptions();
            if (fieldOptions != null)
                fieldOptions.addXml(elem, flags);
            // done
            return elem;
        }
View Full Code Here

            addIndex("PERSON_NAME_IDX", true, new DBColumn[] { C_FIRSTNAME, C_LASTNAME, C_DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(C_UPDATE_TIMESTAMP);
           
            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "!option.employee.gender.male");
            genders.set("F", "!option.employee.gender.female");
            C_GENDER.setOptions(genders);
            C_GENDER.setControlType("select");
           
            // Set special control types
            C_DEPARTMENT_ID.setControlType("select");
View Full Code Here

            {   // Not enough columns
                error(Errors.InvalidArg, sqlCmd, "sqlCmd");
                return null;
            }
            // Check Result
            Options result = new Options();
            while (rs.next())
            {
                Object value = rs.getObject(1);
                String text  = rs.getString(2);
                result.add(value, text, true);
            }
            // No Value
            if (log.isInfoEnabled())
                log.info("queryOptionList retured "+String.valueOf(result.size())+" items. Query completed in " + String.valueOf(System.currentTimeMillis() - start) + " ms");
            clearError();
            return result;
        } catch (SQLException e)
        {
            error(DBErrors.QueryFailed, e);
View Full Code Here

            addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(UPDATE_TIMESTAMP);

            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "Male");
            genders.set("F", "Female");
            GENDER.setOptions(genders);
        }
View Full Code Here

    }

    @Override
    public Options getFieldOptions(Column column) {
     
      Options opts = null;
      if(column.equals(T.C_DEPARTMENT_ID))
      {
        opts = getDepartments(context);
      }
      else
View Full Code Here

      return opts;
    }
   
    public static Options getDepartments(SampleContext context)
    {
      Options opts = new Options();
      List<Department> _deps = context.getEmployeeServiceClient().getDepartments();
      for(Department d: _deps)
      {
        opts.add(new OptionEntry(d.getDepartmentId(),d.getName()));
      }
      return opts;
    }
View Full Code Here

     * @param conn a valid connection to the database.
     * @return an Options object containing a set a of values and their corresponding names
     */
    public final Options queryOptionList(DBCommand cmd, Connection conn)
    {   // Execute the  Statement
        Options options = new Options();
        queryOptionList(cmd.getSelect(), cmd.getParamValues(), conn, options);
        return options;
    }
View Full Code Here

                elem.setAttribute("size", String.valueOf(size));
            // add All Attributes
            if (attributes != null)
                attributes.addXml(elem, flags);
            // add All Options
            Options fieldOptions = getOptions();
            if (fieldOptions != null)
                fieldOptions.addXml(elem, flags);
            // done
            return elem;
        }
View Full Code Here

TOP

Related Classes of org.apache.empire.commons.Options

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.