دورة حياة الكيان
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
name the four states and the moves between them.
الموضوعات المخطط لها
- Transient: new object, not known to JPA.
- Managed: tracked by the persistence context; changes are saved at flush.
- Detached: was managed, but the context closed (usually after the transaction).
- Removed: marked for deletion at flush.
persistmakes transient managed;mergecopies a detached state into a managed instance;removeschedules deletion.
تفاصيل المخطط المبدئي
عرض عملي
a diagram: new → transient → persist → managed → remove → removed; managed → context closes → detached → merge → managed.
اختبر فهمك
Are changes to a detached entity saved automatically?
أظهر الإجابة
No.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.