All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joinedworkz.common.strategies.ColumnNameStrategy.xtend Maven / Gradle / Ivy

There is a newer version: 1.3.46
Show newest version
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 {
    
    @Inject
    extension NameHelper
    
    @Inject
    extension CmnModelHelper
    
    override Object apply(CmnObject obj) {
        if (obj instanceof CmnField) {
            return obj.defaultColumnName
        }
    }
    
    def String defaultColumnName(CmnField it) {
        '''«javaDtoFieldName.camelCaseToUnderLineSeperated.toLowerCase»'''
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy