Package org.apache.openjpa.lib.util

Examples of org.apache.openjpa.lib.util.Options


     *            Whether this hint originated from the @Datacache annotation or whether this is the default "yes" hint.
     *            The origination of the hint influences the decision making process in rule #2b.
     *
     */
    public void setIsCacheable(boolean isCacheable, boolean annotationOverride) {
      Options dataCacheOptions = getDataCacheOptions();
      Set excludedTypes = extractDataCacheClassListing(dataCacheOptions.getProperty("ExcludedTypes", null));
      Set types = extractDataCacheClassListing(dataCacheOptions.getProperty("Types", null));
     
      String className = getDescribedType().getName();
      if (excludedTypes != null && excludedTypes.contains(className)) {
        // Rule #1
        _isCacheable = Boolean.FALSE;
View Full Code Here


     * Extract all of the DataCache plugin options from the configuration
     *
     */
    private Options getDataCacheOptions() {
      String dataCacheConfig = getRepository().getConfiguration().getDataCache();
      Options dataCacheOptions =
        Configurations.parseProperties(Configurations.getProperties(dataCacheConfig));
      return dataCacheOptions;   
    }
View Full Code Here

     * explicitly declares the persistence-capable interface, it will
     * not be enhanced. Thus, it is safe to invoke the enhancer on classes
     * that are already enhanced.
     */
    public static void main(String[] args) {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        if (!run(args, opts))
            System.err.println(_loc.get("enhance-usage"));
    }
View Full Code Here

     * <li><i>get</i>: Print the next sequence value.</li>
     * </ul>
     */
    public static void main(String[] args)
        throws Exception {
        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws Exception {
                JDBCConfiguration conf = new JDBCConfigurationImpl();
                try {
View Full Code Here

     * <li><i>get</i>: Print the next sequence value.</li>
     * </ul>
     */
    public static void main(String[] args)
        throws Exception {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        try {
            if (!run(conf, args, opts))
                System.out.println(_loc.get("native-seq-usage"));
        } finally {
View Full Code Here

     * the database schemas defined by the system configuration will be
     * reverse-mapped.
     */
    public static void main(String[] args)
        throws IOException, SQLException {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        try {
            if (!run(conf, args, opts))
                System.out.println(_loc.get("revtool-usage"));
        } finally {
View Full Code Here

            }
            customProps.load(fis);
        }
       
        // separate the properties for the customizer and code format
        Options customOpts = new Options();
        Options formatOpts = new Options();
        Map.Entry entry;
        String key;
        for (Iterator itr = opts.entrySet().iterator(); itr.hasNext();) {
            entry = (Map.Entry) itr.next();
            key = (String) entry.getKey();
            if (key.startsWith("customizer.")) {
                customOpts.put(key.substring(11), entry.getValue());
                itr.remove();
            } else if (key.startsWith("c.")) {
                customOpts.put(key.substring(2), entry.getValue());
                itr.remove();
            } else if (key.startsWith("codeFormat.")) {
                formatOpts.put(key.substring(11), entry.getValue());
                itr.remove();
            } else if (key.startsWith("cf.")) {
                formatOpts.put(key.substring(3), entry.getValue());
                itr.remove();
            }
        }

        // code format
        if (!formatOpts.isEmpty()) {
            flags.format = new CodeFormat();
            formatOpts.setInto(flags.format);
        }

        // setup a configuration instance with cmd-line info
        Configurations.populateConfiguration(conf, opts);
        ClassLoader loader = conf.getClassResolverInstance().
View Full Code Here

     * application id, it will be backed up to a file named
     * &lt;orig file name&gt;~.
     */
    public static void main(String[] args)
        throws IOException, ClassNotFoundException {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
        try {
            if (!run(conf, args, opts))
                System.err.println(_loc.get("appid-usage"));
        } finally {
View Full Code Here

        flags.token = opts.removeProperty("token", "t", flags.token);
        flags.name = opts.removeProperty("name", "n", flags.name);
        flags.suffix = opts.removeProperty("suffix", "s", flags.suffix);

        // separate the properties for the customizer and code format
        Options formatOpts = new Options();
        Map.Entry entry;
        String key;
        for (Iterator itr = opts.entrySet().iterator(); itr.hasNext();) {
            entry = (Map.Entry) itr.next();
            key = (String) entry.getKey();
            if (key.startsWith("codeFormat.")) {
                formatOpts.put(key.substring(11), entry.getValue());
                itr.remove();
            } else if (key.startsWith("cf.")) {
                formatOpts.put(key.substring(3), entry.getValue());
                itr.remove();
            }
        }
        if (!formatOpts.isEmpty()) {
            flags.format = new CodeFormat();
            formatOpts.setInto(flags.format);
        }

        Configurations.populateConfiguration(conf, opts);
        ClassLoader loader = conf.getClassResolverInstance().
            getClassLoader(ApplicationIdTool.class, null);
View Full Code Here

     * <li><i>set</i>: Set the sequence value.</li>
     * </ul>
     */
    public static void main(String[] args)
        throws Exception {
        Options opts = new Options();
        args = opts.setFromCmdLine(args);
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        try {
            if (!run(conf, args, opts))
                System.out.println(_loc.get("seq-usage"));
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.util.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.