beta.blog

hybris: Lift 24 Character Deployment Table Name Length

by on Feb.21, 2019, under Programming

When defining a new Itemtype in SAP hybris we may choose a deployment table as shown below:

<itemtype code="MyCustomComponent" extends="SimpleCMSComponent"
          jaloclass="us.betamaster.tomatoproject.core.jalo.components.MyCustomComponent">
    <deployment table="prettylongtablenameexceedingalengthof24characters" typecode="10205"/>
    <attributes>
        ...
    </attributes>
</itemtype>

However, there is a limit of 24 characters due to database server restrictions, resulting in an error:

java.lang.RuntimeException: cannot create deployment for type MyCustomComponent - the table name prettylongtablenameexceedingalengthof24characters is too long or it has invalid characters

Let’s take a look at the file hybris/bin/platform/resources/advanced.properties

# Check of table name length and illegal characters at initialization
deployment.checktablename=true

# Check of deployment change at initialization
deployment.check=true

# max table name length (excluding tenant prefix)
deployment.tablename.maxlength=24

We can simply disable this limit by setting the property deployment.checktablename to false:

deployment.checktablename=false

Keep in mind, though, that unlike MySQL, which has a default limit of 64 characters, various other database servers such as Oracle DB might have a limit of ~30 characters.

:,

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!