// Path: obridge-main/src/main/java/org/obridge/context/OBridgeConfiguration.java
// public class OBridgeConfiguration {
// 
//     public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;
//     public static final boolean ADD_ASSERT = false;
// 
//     private String jdbcUrl;
//     private String sourceRoot;
//     private String rootPackageName;
//     private Packages packages;
//     private Logging logging;
//     private String packagesLike;
//     private String sourceOwner;
//     private String projectName;
//     private String sourcesTableProc;
//     private String sourcesTable;
// 
//     public String getPackagesLike() {
//         if (packagesLike == null) {
//             return "%";
//         }
//         return packagesLike;
//     }
// 
//     public void setPackagesLike(String packagesLike) {
//         this.packagesLike = packagesLike;
//     }
// 
//     public String getSourceOwner() {
//         return sourceOwner;
//     }
// 
//     public void setSourceOwner(String sourceOwner) {
//         this.sourceOwner = sourceOwner;
//     }
// 
//     public String getJdbcUrl() {
//         return jdbcUrl;
//     }
// 
//     public void setJdbcUrl(String jdbcUrl) {
//         this.jdbcUrl = jdbcUrl;
//     }
// 
//     public String getSourceRoot() {
//         return sourceRoot;
//     }
// 
//     public void setSourceRoot(String sourceRoot) {
//         this.sourceRoot = sourceRoot;
//     }
// 
//     public String getRootPackageName() {
//         return rootPackageName;
//     }
// 
//     public void setRootPackageName(String rootPackageName) {
//         this.rootPackageName = rootPackageName;
//     }
// 
//     public Packages getPackages() {
//         return packages;
//     }
// 
//     public void setPackages(Packages packages) {
//         this.packages = packages;
//     }
// 
//     public Logging getLogging() {
//         return logging;
//     }
// 
//     public void setLogging(Logging logging) {
//         this.logging = logging;
//     }
// 
//     public String getSourcesTable() {
//         return sourcesTable;
//     }
// 
//     public void setSourcesTable(String sourcesTable) {
//         this.sourcesTable = sourcesTable;
//     }
// 
//     public String getSourcesTableProc() {
//         return sourcesTableProc;
//     }
// 
//     public String getProjectName() { return projectName == null ? "default": projectName; }
// 
//     public void setProjectName(String projectName) { this.projectName = projectName; }
// }
// 
// Path: obridge-main/src/main/java/org/obridge/util/OBridgeException.java
// public class OBridgeException extends RuntimeException {
// 
//     public OBridgeException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public OBridgeException(Throwable cause) {
//         super(cause);
//     }
// 
//     public OBridgeException(String message) {
//         super(message);
//     }
// }
// 
// Path: obridge-main/src/main/java/org/obridge/util/XStreamFactory.java
// public class XStreamFactory {
// 
//     private XStreamFactory() {
//     }
// 
//     public static XStream createXStream() {
//         XStream xStream = new XStream();
// 
//         xStream.alias("configuration", OBridgeConfiguration.class);
// 
//         return xStream;
//     }
// 
// }


import java.io.File;
import java.io.IOException;
import java.util.Properties;
import com.thoughtworks.xstream.XStream;
import org.apache.commons.cli.*;
import org.obridge.context.OBridgeConfiguration;
import org.obridge.generators.*;
import org.obridge.util.OBridgeException;
import org.obridge.util.XStreamFactory;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Ferenc Karsany
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

package org.obridge;



public class OBridge {

    public static void main(String... args) {

        try {

            Options o = new Options();
            CommandLine cmd = getCommandLine(o, args);

            if (cmd.hasOption("h")) {
                printHelp(o);
                return;
            }

            if (cmd.hasOption("v")) {
                printVersion();
                return;
            }

            if (cmd.hasOption("c")) {
                new OBridge().generate(new File(cmd.getOptionValue("c")));
            } else {
                printHelp(o);
            }

        } catch (ParseException e) {
// Path: obridge-main/src/main/java/org/obridge/context/OBridgeConfiguration.java
// public class OBridgeConfiguration {
// 
//     public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;
//     public static final boolean ADD_ASSERT = false;
// 
//     private String jdbcUrl;
//     private String sourceRoot;
//     private String rootPackageName;
//     private Packages packages;
//     private Logging logging;
//     private String packagesLike;
//     private String sourceOwner;
//     private String projectName;
//     private String sourcesTableProc;
//     private String sourcesTable;
// 
//     public String getPackagesLike() {
//         if (packagesLike == null) {
//             return "%";
//         }
//         return packagesLike;
//     }
// 
//     public void setPackagesLike(String packagesLike) {
//         this.packagesLike = packagesLike;
//     }
// 
//     public String getSourceOwner() {
//         return sourceOwner;
//     }
// 
//     public void setSourceOwner(String sourceOwner) {
//         this.sourceOwner = sourceOwner;
//     }
// 
//     public String getJdbcUrl() {
//         return jdbcUrl;
//     }
// 
//     public void setJdbcUrl(String jdbcUrl) {
//         this.jdbcUrl = jdbcUrl;
//     }
// 
//     public String getSourceRoot() {
//         return sourceRoot;
//     }
// 
//     public void setSourceRoot(String sourceRoot) {
//         this.sourceRoot = sourceRoot;
//     }
// 
//     public String getRootPackageName() {
//         return rootPackageName;
//     }
// 
//     public void setRootPackageName(String rootPackageName) {
//         this.rootPackageName = rootPackageName;
//     }
// 
//     public Packages getPackages() {
//         return packages;
//     }
// 
//     public void setPackages(Packages packages) {
//         this.packages = packages;
//     }
// 
//     public Logging getLogging() {
//         return logging;
//     }
// 
//     public void setLogging(Logging logging) {
//         this.logging = logging;
//     }
// 
//     public String getSourcesTable() {
//         return sourcesTable;
//     }
// 
//     public void setSourcesTable(String sourcesTable) {
//         this.sourcesTable = sourcesTable;
//     }
// 
//     public String getSourcesTableProc() {
//         return sourcesTableProc;
//     }
// 
//     public String getProjectName() { return projectName == null ? "default": projectName; }
// 
//     public void setProjectName(String projectName) { this.projectName = projectName; }
// }
// 
// Path: obridge-main/src/main/java/org/obridge/util/OBridgeException.java
// public class OBridgeException extends RuntimeException {
// 
//     public OBridgeException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public OBridgeException(Throwable cause) {
//         super(cause);
//     }
// 
//     public OBridgeException(String message) {
//         super(message);
//     }
// }
// 
// Path: obridge-main/src/main/java/org/obridge/util/XStreamFactory.java
// public class XStreamFactory {
// 
//     private XStreamFactory() {
//     }
// 
//     public static XStream createXStream() {
//         XStream xStream = new XStream();
// 
//         xStream.alias("configuration", OBridgeConfiguration.class);
// 
//         return xStream;
//     }
// 
// }


// Path: obridge-main/src/main/java/org/obridge/OBridge.java
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import com.thoughtworks.xstream.XStream;
import org.apache.commons.cli.*;
import org.obridge.context.OBridgeConfiguration;
import org.obridge.generators.*;
import org.obridge.util.OBridgeException;
import org.obridge.util.XStreamFactory;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Ferenc Karsany
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

package org.obridge;



public class OBridge {

    public static void main(String... args) {

        try {

            Options o = new Options();
            CommandLine cmd = getCommandLine(o, args);

            if (cmd.hasOption("h")) {
                printHelp(o);
                return;
            }

            if (cmd.hasOption("v")) {
                printVersion();
                return;
            }

            if (cmd.hasOption("c")) {
                new OBridge().generate(new File(cmd.getOptionValue("c")));
            } else {
                printHelp(o);
            }

        } catch (ParseException e) {
            throw new OBridgeException("Exception in OBridge Main progam", e);