Make sure all FK names are <= 18 characters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Make sure all FK names are <= 18 characters

Rodrigo Lima-2
Hi Community!
I made an alteration to correct a BUG in the verification of the size
of the name of relations.
It is approved?
The source:


Class : org.ofbiz.entity.model.ModelEntityChecker

Method : checkEntities
Line 209
// make sure all FK names are <= 18 characters but now read in XML Config

DatasourceInfo di =
EntityConfigUtil.getDatasourceInfo(delegator.getEntityHelperName(relation.getRelEntityName()));


if ( relation.getFkName().length() > di.constraintNameClipLength ) {

        warningList.add("[RelFKNameGT] The foregn key name (length:" +
relation.getFkName().length()
         + ") was greater than " + di.constraintNameClipLength
         + " characters in length for relation " + relation.getTitle()
+ relation.getRelEntityName()
         + " of entity " + entity.getEntityName() + ".");
}
Reply | Threaded
Open this post in threaded view
|

Re: Make sure all FK names are <= 18 characters

Jacques Le Roux
Administrator
Please create a Jira Issue instead
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

Jacques

De : "Rodrigo Souza" <[hidden email]>

> Hi Community!
> I made an alteration to correct a BUG in the verification of the size
> of the name of relations.
> It is approved?
> The source:
>
>
> Class : org.ofbiz.entity.model.ModelEntityChecker
>
> Method : checkEntities
> Line 209
> // make sure all FK names are <= 18 characters but now read in XML Config
>
> DatasourceInfo di =
> EntityConfigUtil.getDatasourceInfo(delegator.getEntityHelperName(relation.getRelEntityName()));
>
>
> if ( relation.getFkName().length() > di.constraintNameClipLength ) {
>
>         warningList.add("[RelFKNameGT] The foregn key name (length:" +
> relation.getFkName().length()
>          + ") was greater than " + di.constraintNameClipLength
>          + " characters in length for relation " + relation.getTitle()
> + relation.getRelEntityName()
>          + " of entity " + entity.getEntityName() + ".");
> }