Computer Science A
Learning Goals 3
Learning Goals 3
Learning Goals 3
Learning Goals 3
Learning Goals 3
Learning Goals 3
Learning Goals 4
Learning Goals 3
Learning Goals 4
Java Persistence API (JPA)
JPA Repository
JPA maps an @Entity class to a database table. A repository gives a controller standard create, read, update, and delete operations without writing common SQL.
public interface DataRepository extends JpaRepository<Data, Long> {
List<Data> findByNameIgnoreCase(String name);
}
Data is the entity type and Long is the type of its @Id. findAll(), findById(id), save(entity), and deleteById(id) are supplied by JpaRepository; a method such as findByNameIgnoreCase is a derived query.
For this assignment, inspect the SQLite schema after starting Spring. If you change the entity structure, remove /volumes/sqlite.db and restart so the schema is rebuilt as specified in Java Spring Hacks.
Course Timeline
Week 0 Chat click to open
No messages yet.
Week 1 Chat click to open
No messages yet.
Week 2 Chat click to open
No messages yet.
Week 3 Chat click to open
No messages yet.
Week 4 Chat click to open
No messages yet.
Week 5 Chat click to open
No messages yet.
Week 6 Chat click to open
No messages yet.
Week 13 Chat click to open
No messages yet.
Week 17 Chat click to open
No messages yet.
Week 18 Chat click to open
No messages yet.
Week 19 Chat click to open
No messages yet.
Week 21 Chat click to open
No messages yet.
Week 22 Chat click to open
No messages yet.
Week 25 Chat click to open
No messages yet.
Week 27 Chat click to open
No messages yet.
Week 31 Chat click to open
No messages yet.
Week 34 Chat click to open
No messages yet.