Announcement Announcement Module
Collapse
No announcement yet.
"Protected" as a column name? allowed? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Protected" as a column name? allowed?

    I am trying out SpringRoo 1.1.0 release with Database Reverse Engineering . I got it working "ok" a few weeks ago but am now having problems with a new database...

    I was getting errors like
    The method getUid() is undefined for the type TwitterAccount
    The method getHost() is undefined for the type TwitterAccount
    The method getScreenName() is undefined for the type TwitterAccount
    when they do exist.

    I also noticed


    [ERROR] Syntax error on token "protected", privileged expected
    [ERROR] Syntax error on token "import", around expected
    [ERROR] Syntax error on token "protected", privileged expected
    [ERROR] Syntax error on tokens, declare [error | warning | parents | soft | precedence] expected instead

    and realised that there is a column in my database called "protected". This results in my generated code including such gems as

    public void TwitterAccount.setProtected(Integer protected) {


    Is this a bug which should be investigated and reported?

    I don't easily have the capability of changing this (third party) database schema so is there a work around?

    Possibly useful info...

    Here is my log.roo

    // Spring Roo 1.1.0.RELEASE [rev 793f2b0] log opened at 2011-01-10 13:09:59
    project --topLevelPackage uk.co.me.friendslinks.drupalreader
    persistence setup --provider HIBERNATE --database MYSQL --databaseName drupal_friendslinks --userName friendslinks
    database introspect --schema schemaname
    database reverse engineer --schema drupal_friendslinks --package ~.domain
    controller all --package ~.web
    perform tests



    And here is the database introspect for that problem table



    <table name="twitter_account">
    <column index="1" name="twitter_uid" primaryKey="true" required="true" size="20,0" type="DECIMAL"/>
    <column index="2" name="uid" primaryKey="false" required="true" size="20" type="BIGINT"/>
    <column index="3" name="host" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="4" name="screen_name" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="5" name="password" primaryKey="false" required="false" size="64" type="VARCHAR"/>
    <column index="6" name="oauth_token" primaryKey="false" required="false" size="64" type="VARCHAR"/>
    <column index="7" name="oauth_token_secret" primaryKey="false" required="false" size="64" type="VARCHAR"/>
    <column index="8" name="name" primaryKey="false" required="true" size="64" type="VARCHAR"/>
    <column index="9" name="description" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="10" name="location" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="11" name="followers_count" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="12" name="friends_count" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="13" name="statuses_count" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="14" name="favourites_count" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="15" name="url" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="16" name="profile_image_url" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="17" name="protected" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="18" name="profile_background_color" primaryKey="false" required="true" size="6" type="VARCHAR"/>
    <column index="19" name="profile_text_color" primaryKey="false" required="true" size="6" type="VARCHAR"/>
    <column index="20" name="profile_link_color" primaryKey="false" required="true" size="6" type="VARCHAR"/>
    <column index="21" name="profile_sidebar_fill_color" primaryKey="false" required="true" size="6" type="VARCHAR"/>
    <column index="22" name="profile_sidebar_border_color" primaryKey="false" required="true" size="6" type="VARCHAR"/>
    <column index="23" name="profile_background_image_url" primaryKey="false" required="false" size="255" type="VARCHAR"/>
    <column index="24" name="profile_background_tile" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="25" name="verified" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="26" name="created_at" primaryKey="false" required="true" size="64" type="VARCHAR"/>
    <column index="27" name="created_time" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="28" name="utc_offset" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="29" name="import" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="30" name="last_refresh" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <column index="31" name="is_global" primaryKey="false" required="true" size="10" type="INTEGER"/>
    <unique name="PRIMARY">
    <unique-column name="twitter_uid" sequenceNumber="1"/>
    </unique>
    <index name="screen_name">
    <index-column name="screen_name" sequenceNumber="1"/>
    </index>
    </table>
Working...
X