org.joinedworkz.common.strategies.ColumnNameStrategy.xtend Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-base Show documentation
Show all versions of common-base Show documentation
DSL based modeling framework - facilities common base
package org.joinedworkz.common.strategies
import org.joinedworkz.common.helper.NameHelper
import org.joinedworkz.core.facility.AbstractStrategy
import org.joinedworkz.core.model.CmnField
import org.joinedworkz.core.model.CmnObject
import javax.inject.Singleton
import org.joinedworkz.common.helper.CmnModelHelper
import javax.inject.Inject
@Singleton
class ColumnNameStrategy extends AbstractStrategy {
protected extension NameHelper nameHelper = new NameHelper
@Inject
extension CmnModelHelper
override Object apply(CmnObject obj) {
if (obj instanceof CmnField) {
return obj.defaultColumnName
}
}
def String defaultColumnName(CmnField it) {
'''«javaDtoFieldName.camelCaseToUnderLineSeperated.toLowerCase»'''
}
}