SFieldBooleanChar doesn't seem to work with MySQL

"fdaoud00" <[email protected]> Mon, 29 Dec 2008 05:48:36 -0000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
SFieldBooleanChar's defaultSqlDataType() method returns "VARCHAR",
which doesn't work with MySQL when creating a table.

I'm using this as a workaround:

class SFieldBooleanFixedChar extends SFieldBooleanChar {
    private int length;

    public SFieldBooleanFixedChar(SRecordMeta<?> meta, String colName,
String tval, String fval, SFieldFlags... flags) {
        super(meta, colName, tval, fval);
        length = Math.max(tval.length(), fval.length());
    }

    @Override
    public String defaultSqlDataType() {
        return String.format("CHAR(%d)", length);
    }
}

Is this a bug, or should I be doing something differently? Please advise.

Congratulations on SimpleORM, I'm liking it very much so far.

Best regards,
Frederic Daoud
Author, "Stripes ...and Java Web Development is Fun Again"
http://www.pragprog.com/titles/fdstr



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/