Skip to content

Instantly share code, notes, and snippets.

@dstarh
Created April 8, 2011 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstarh/910055 to your computer and use it in GitHub Desktop.
Save dstarh/910055 to your computer and use it in GitHub Desktop.
def dao = """
package com.activedg.vendor.dao;
import org.springframework.stereotype.Repository;
import com.activedg.vendor.model.${args[0]};
@Repository
public class ${args[0]}Dao extends GenericDAO<${args[0]}, Long> {
public ${args[0]}Dao() {
super(${args[0]}.class);
}
}
"""
def service = """
package com.activedg.vendor.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.activedg.vendor.dao.${args[0]}Dao;
import com.activedg.vendor.model.${args[0]};
@Service
public class ${args[0]}Service {
@Autowired
private ${args[0]}Dao ${args[0]}Dao;
public ${args[0]} get(Long id){
return ${args[0]}Dao.get(id);
}
}
"""
println dao
println ''
println ''
println service
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment