Package org.apache.openjpa.lib.util

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


        File dir = Files.getClassFile(ProxyManagerImpl.class);
        dir = (dir == null) ? new File(AccessController.doPrivileged(
            J2DoPrivHelper.getPropertyAction("user.dir")))
            : dir.getParentFile();

        Options opts = new Options();
        args = opts.setFromCmdLine(args);

        List types = new ArrayList();
        types.addAll(Arrays.asList(args));
        int utils = opts.removeIntProperty("utils", "u", 0);
        if (utils >= 4) {
            types.addAll(Arrays.asList(new String[] {
                java.sql.Date.class.getName(),
                java.sql.Time.class.getName(),
                java.sql.Timestamp.class.getName(),
View Full Code Here


     * application id, it will be backed up to a file named
     * <orig file name>~.
     */
    public static void main(String[] args)
        throws IOException, ClassNotFoundException {
        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts)
                throws ClassNotFoundException, IOException {
                OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
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>drop</i>: Drop the schema table.</li>
     * </ul>
     */
    public static void main(String[] args)
        throws IOException, SQLException {
        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

    /**
     * Install listeners and base decorators.
     */
    public static DecoratingDataSource decorateDataSource(DataSource ds,
        JDBCConfiguration conf, boolean factory2) {
        Options opts = Configurations.parseProperties((factory2)
            ? conf.getConnectionFactory2Properties()
            : conf.getConnectionFactoryProperties());
        Log jdbcLog = conf.getLog(JDBCConfiguration.LOG_JDBC);
        Log sqlLog = conf.getLog(JDBCConfiguration.LOG_SQL);

View Full Code Here

                // add trace info for autoCommit setting
                if (log.isTraceEnabled())
                    log.trace(_loc.get("set-auto-commit", new Object[] {
                    dict.supportsMultipleNontransactionalResultSets}));
            }
            Options opts = Configurations.parseProperties((factory2)
                ? conf.getConnectionFactory2Properties()
                : conf.getConnectionFactoryProperties());
            Configurations.configureInstance(ccd, conf, opts);
            ds.addDecorator(ccd);
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>drop</i>: Drop the schema table.</li>
     * </ul>
     */
    public static void main(String[] args)
        throws IOException, SQLException {
        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

     * 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();
        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

            }
            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

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.