Skip to content

Commit

Permalink
for issue #133, change converted private methods to protected so they…
Browse files Browse the repository at this point in the history
… may be called by override classes, and remove useIdSuffixInForeignKey() which is provided in Properties class
  • Loading branch information
rcodesmith committed Jun 26, 2014
1 parent b68dcbc commit 69d769a
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,14 @@ public class DbHelper {
name
}

private def checkIdAttribute(DomainObject referencedClass, Attribute idAttribute) {
protected def checkIdAttribute(DomainObject referencedClass, Attribute idAttribute) {
if (idAttribute === null) {
throw new IllegalArgumentException(
'Referenced class ' + referencedClass.name + " doesn't contain 'id' attribute");
}
}

private def convertDatabaseName(String name) {
protected def convertDatabaseName(String name) {
var String resName = name

if (propertiesBase.getBooleanProperty('db.useUnderscoreNaming')) {
Expand All @@ -438,8 +438,8 @@ public class DbHelper {
truncateLongDatabaseName(resName).toUpperCase
}

private def idSuffix(String name, DomainObject to) {
if (useIdSuffixInForeignKey) {
protected def idSuffix(String name, DomainObject to) {
if (useIdSuffixInForeigKey) {
var idAttribute = getIdAttribute(to)
if (idAttribute !== null) {
var idName = idAttribute.databaseColumn.toUpperCase
Expand All @@ -459,9 +459,4 @@ public class DbHelper {
''
}

private def useIdSuffixInForeignKey() {
propertiesBase.getBooleanProperty('db.useIdSuffixInForeigKey')
}


}

0 comments on commit 69d769a

Please sign in to comment.