انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-026-L05

عرض عملي: استبدال المستودع في الذاكرة بـ Spring JDBC

  • الدرس 5 من 5
  • Junior
في هذا الدرس 3 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

swap the Shop repository implementation without touching controllers or services; prepares JNR-026-LAB1.

تفاصيل المخطط المبدئي

خطوة بخطوة

  1. Show the existing ProductRepository interface and the in-memory implementation.
  2. Apply schema.sql manually in local PostgreSQL and add the datasource properties.
  3. Create JdbcProductRepository implements ProductRepository using JdbcClient and a shared mapper.
  4. Planned mistake: forget the @Repository/bean switch so two implementations exist; show the startup error and remove the in-memory bean.
  5. Run the existing API tests; they pass unchanged.
  6. Add one integration test against a real PostgreSQL database.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.