This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Dao<T, ID extends Serializable> { | |
| public List<T> read(); | |
| public T read(ID id); | |
| public void save(T t); | |
| public void delete(T t); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SqlMapBaseDao<T, ID extends Serializable> extends SqlMapClientDaoSupport implements Dao<T, ID> { | |
| private Class<T> entityClass; | |
| @Autowired | |
| @SuppressWarnings("unchecked") | |
| public void init(SqlMapClient sqlMapClient) { | |
| entityClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; | |
| setSqlMapClient(sqlMapClient); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Repository(UserDao.DAO_ID) | |
| public class SqlMapUserDao extends SqlMapBaseDao<User, Integer> implements UserDao { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum Rating { | |
| G("G"),PG("PG"),PG13("PG-13"),R("R"),NC17("NC-17"),NR("Not Rated") | |
| final String value | |
| Rating(String value) { | |
| this.value = value | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArmoryController { | |
| static allowedMethods = [queryAmory:'GET'] | |
| def queryAmory = { | |
| String url = "http://www.wowarmory.com/search.xml?searchQuery=${params['id']}&searchType=items" | |
| URL u = new URL(url); | |
| URLConnection conn = u.openConnection() | |
| String response = conn.content.text | |
| render response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javafx.stage.Stage; | |
| import javafx.scene.Scene; | |
| import javafx.scene.shape.Circle; | |
| import javafx.scene.paint.Color; | |
| import javafx.scene.image.ImageView; | |
| import javafx.scene.image.Image; | |
| import javafx.scene.*; | |
| import javafx.scene.shape.*; | |
| import javafx.scene.text.*; | |
| import javafx.animation.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def colors = Color.list() | |
| colors = colors.collect { | |
| [cell: [it.name, it.description], id: it.id] | |
| } | |
| def jsonColors = [page: "${params.page}", records: numRecords, rows: colors, total: totalPages] | |
| render jsonColors as JSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def gridList = { | |
| Integer page = Integer.parseInt(params.page) | |
| Integer rows = Integer.parseInt(params.rows) | |
| Integer numRecords = Color.count() | |
| Integer totalPages = 0 | |
| if (numRecords > 0) { | |
| totalPages = Math.ceil(numRecords / rows); | |
| } | |
| if (page > totalPages) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def gridList = { | |
| Integer page = Integer.parseInt(params.page) | |
| Integer rows = Integer.parseInt(params.rows) | |
| def sidx = params.sidx | |
| def sord = params.sord | |
| def color = new Color(params) | |
| render colorService.filterColors(page, rows, sidx, sord, color) as JSON | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Test { | |
| public Test() { | |
| } | |
| public static void main(String[] args) { | |
| System.out.println("Hello Hycel"); | |
| } |