package net.jonp.sorm;

/**
 * Describes a database dialect and provides a few default dialects.
 */
public class Dialect
{
    /** The dialect of an H2 database. */
    public static final Dialect H2 = new Dialect("h2", "org.h2.Driver", "jdbc:h2:");

    /** The dialect of a MySQL database. */
    public static final Dialect MySQL = new Dialect("mysql", "com.mysql.jdbc.Driver", "jdbc:mysql://");

    /** The dialect of a PostgreSQL database. */
    public static final Dialect PostgreSQL = new Dialect("postgresql", "org.postgresql.Driver", "jdbc:postgresql://");

    /** The dialect of a SQLite database. */
    public static final Dialect SQLite = new Dialect("sqlite", "org.sqlite.JDBC", "jdbc:sqlite:");

    /** The name of this dialect. */
    private final String name;

    /** The JDBC driver to use for databases that speak this dialect. */
    private final String driver;

    /**
     * The JDBC protocol prefix to use for URLs to databases that speak this
     * dialect.
     */
    private final String protocol;

    /**
     * Construct a new Dialect.
     * 
     * @param _name The name of the dialect.
     * @param _driver The driver class.
     * @param _protocol The protocol.
     */
    public Dialect(final String _name, final String _driver, final String _protocol)
    {
        name = _name;
        driver = _driver;
        protocol = _protocol;
    }

    /** Get the name of this dialect. */
    public String getName()
    {
        return name;
    }

    /** Get the JDBC driver to use for databases that speak this dialect. */
    public String getDriver()
    {
        return driver;
    }

    /**
     * Get the JDBC protocol prefix to use for URLs to databases that speak this
     * dialect.
     */
    public String getProtocol()
    {
        return protocol;
    }
}

@@ -1811,11 +1811,525 @@
 l;%0A    %7D
+%0A%0A    @Override%0A    public String toString()%0A    %7B%0A        return String.format(%22%25s%5B%25s%5D(%25s)%22, getName(), getDriver(), getProtocol());%0A    %7D%0A%0A    @Override%0A    public boolean equals(final Object o)%0A    %7B%0A        if (null == o) %7B%0A            return false;%0A        %7D%0A        else if (o instanceof Dialect) %7B%0A            return toString().equals(o.toString());%0A        %7D%0A        else %7B%0A            return false;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public int hashCode()%0A    %7B%0A        return toString().hashCode();%0A    %7D
 %0A%7D%0A

Add basic object comparison and description methods to Dialect.