Skip to content

Instantly share code, notes, and snippets.

@marlalain
Created December 24, 2021 16:21
Show Gist options
  • Save marlalain/9d4dc7b02b30b6c377374ac7d4977fe2 to your computer and use it in GitHub Desktop.
Save marlalain/9d4dc7b02b30b6c377374ac7d4977fe2 to your computer and use it in GitHub Desktop.
Slinky Examples
@Entity
@Table(name = "todos")
data class Todo(
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
override var id: Long?,
var name: String?,
var description: String?,
var completed: Boolean?
) : IGenericEntity<Long>
@Service
class TodoBusiness(repository: TodoRepository) : GenericBusiness<Todo, Long>(repository)
@RestController
@RequestMapping("/api/v1/todos")
class TodoController(business: TodoBusiness) : GenericController<Todo, Long>(business)
@Repository
class TodoRepository(entityManager: EntityManager)
: GenericRepository<Todo, Long>(Todo::class.java, entityManager)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment