Skip to content

enso-works/GenericJdbcRepository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

generic repository

generic repository is small library for persisting java objects

example using jdbc implementation of generic repository which comes from library

	private GenericRepository<Human, Connection> humanRepository = new JdbcRepository<>("human", 
				humanObject -> {
					Map<String, Object> humanData = new LinkedHashMap<>();
					humanData.put("age", humanObject.getAge());
					humanData.put("name", humanObject.getName());
					return humanData;
				},
		resultSet -> {
			return new Human(resultSet.getInt("id"), 
					resultSet.getInt("age"), 
					resultSet.getString("name"));
		});
		
	private Human selectHumanWithAge(int age, Connection connection){
		return humanRepository
					.objectFromWhere("age", age)
					.executeWith(connection);
	}

About

GJR is small java library for persisting java objects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages