Jump to content
Changes to the Jaspersoft community edition download ×

maxValue in table jidatatype on MySql 5.5


pjtech

Recommended Posts

Hi Guys,

I am having an issue where JasperServer is bombing out on MySql 5.5 both on the install and when I attempt to insert a Data Type. Table  jidatatype has a column name of maxValue which I beleve is a reserved word on 5.5.  Has anyone had the same issue or got a workaround?

Thanks Peter

 

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

Thanks for the quick reply.  Yes I done that and you can load the schema.  But the problem is you still cant insert a datatype as the insert bombs out.  For now I reverted to MySql 5.1 and its working fine.

Again Thanks for yor help.

Peter

 

Link to comment
Share on other sites

  • 9 months later...
  • 3 weeks later...

Wondering if this is only applicable to Microsoft Windows MySQL 5.5 users?

The reserved word is MAXVALUE and the table name is maxValue so I think in Linux it should work just fine.

8.2.2. Identifier Case Sensitivity

In MySQL, databases correspond to directories within the data directory.

Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine).

Triggers also correspond to files. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database, table, and trigger names. This means such names are not case sensitive in Windows, but are case sensitive in most varieties of Unix.

http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html

Link to comment
Share on other sites

  • 1 month later...

Cyb,

If you have support, you should contact technical support to see when an update for this is expected. I don't know when it's planned for.

In principle it shouldn't be so difficult to change the column to max_value and then update the hibernate mapping to understand that maxValue maps to the column max_value. Give it a try. It would be a great benefit to others if you can let us know how it works for you.

The actual change would be to jasperserver-repository-hibernate/src/main/resources/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoDataType.hbm.xml

Just change the name of the column to something MySQL 5.5 likes:

<hibernate-mapping>
    <joined-subclass 
           name="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoDataType"
           extends="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResource"
           table="JIDataType">
        <key column="id"/>
        <property name="type"/>
        <property name="maxLength"/>
        <property name="decimals"/>
        <property name="regularExpr"/>
        <property name="minValue" type="serializable"/>
        <property name="maxValue" column="max_value" type="serializable"/>
        <property name="strictMin"/>
        <property name="strictMax"/>
    </joined-subclass>
</hibernate-mapping>

The js-create.ddl script (which is failing for you now) will be generated with the new column name when you rebuild.

Before any of this gets rolled into the real product we need to make sure it works (duh!) but we also need to figure out any upgrade issues. You may not care about that side of things, so you could try it more quickly.

Good luck,
Matt

P.S. Credit goes to Bob T for the code sample.

Link to comment
Share on other sites

 FYI I opened an issue on this a while back.  I also made a similiar change but instead of changing the column name, simply had hibernate quote the column (the brackets are the platform independant way to tell hibernate to quote the column).

What's nice about this approach is no schema changes are necessary and hibernate knows how to quote a column in any database server it is connecting to.  

http://jasperforge.org/plugins/mantis/view.php?id=5008

Code:


Post Edited by ahagopian at 02/22/2011 19:54
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...