ee.telekom.workflow.util.AbstractWorkflowEngineDao Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of workflow-engine Show documentation
Show all versions of workflow-engine Show documentation
Telekom-workflow-engine core provides the runtime environment for workflow execution together with all the supporting services (clustering, persistence, error handling etc).
package ee.telekom.workflow.util;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import ee.telekom.workflow.core.common.WorkflowEngineConfiguration;
public class AbstractWorkflowEngineDao extends AbstractDao{
@Autowired
private WorkflowEngineConfiguration config;
@Override
@Autowired
public void setDataSource( @Qualifier("workflowengineDataSource") DataSource dataSource ){
super.setDataSource( dataSource );
}
public String getCreatedOrLastUpdatedBy(){
return config.getNodeName();
}
protected String getClusterName(){
return config.getClusterName();
}
protected long getNextSequenceValue( String sequence ){
return getJdbcTemplate().queryForObject( "SELECT nextval('" + sequence + "')", Long.class );
}
protected String getSchema() {
return config.getSchema();
}
}