Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: #1684 Renamed package ai.elmu.model to ai.elmu.entity #1686

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DB_MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DB Migration 🔀

By using the Java Persistence API (JPA), classed annotated by `@Entity` (in the [`model`](src/main/java/ai/elimu/model) package) get mapped automatically to database tables/columns: [`src/main/resources/META-INF/jpa-persistence.xml`](https://github.com/elimu-ai/webapp/blob/main/src/main/resources/META-INF/jpa-persistence.xml)
By using the Java Persistence API (JPA), classed annotated by `@Entity` (in the [`model`](src/main/java/ai/elimu/entity) package) get mapped automatically to database tables/columns: [`src/main/resources/META-INF/jpa-persistence.xml`](https://github.com/elimu-ai/webapp/blob/main/src/main/resources/META-INF/jpa-persistence.xml)

> [!IMPORTANT]
> However, when _deleting, modifying or renaming_ an entity class/attribute, we have to manually update the underlying database structure.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/ApplicationDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.admin.Application;
import ai.elimu.entity.admin.Application;

import ai.elimu.model.v2.enums.admin.ApplicationStatus;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/elimu/dao/ApplicationVersionDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.admin.Application;
import ai.elimu.model.admin.ApplicationVersion;
import ai.elimu.entity.admin.Application;
import ai.elimu.entity.admin.ApplicationVersion;

import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/AudioContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.multimedia.Audio;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.AudioContributionEvent;
import ai.elimu.entity.content.multimedia.Audio;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.AudioContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/AudioDao.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.StoryBookParagraph;
import ai.elimu.model.content.Word;
import ai.elimu.entity.content.StoryBookParagraph;
import ai.elimu.entity.content.Word;
import java.util.List;
import ai.elimu.model.content.multimedia.Audio;
import ai.elimu.entity.content.multimedia.Audio;

import org.springframework.dao.DataAccessException;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ai/elimu/dao/AudioPeerReviewEventDao.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.multimedia.Audio;
import ai.elimu.model.contributor.AudioContributionEvent;
import ai.elimu.model.contributor.AudioPeerReviewEvent;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.entity.content.multimedia.Audio;
import ai.elimu.entity.contributor.AudioContributionEvent;
import ai.elimu.entity.contributor.AudioPeerReviewEvent;
import ai.elimu.entity.contributor.Contributor;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/ContributorDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import org.springframework.dao.DataAccessException;

import ai.elimu.model.contributor.Contributor;
import ai.elimu.entity.contributor.Contributor;

public interface ContributorDao extends GenericDao<Contributor> {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/DbMigrationDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.DbMigration;
import ai.elimu.entity.DbMigration;

import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/DeviceDao.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ai.elimu.dao;

import ai.elimu.model.Device;
import ai.elimu.entity.Device;

import org.springframework.dao.DataAccessException;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/elimu/dao/EmojiDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import ai.elimu.model.content.Emoji;
import ai.elimu.model.content.Word;
import ai.elimu.entity.content.Emoji;
import ai.elimu.entity.content.Word;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/ImageContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.multimedia.Image;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.ImageContributionEvent;
import ai.elimu.entity.content.multimedia.Image;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.ImageContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/elimu/dao/ImageDao.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.Word;
import ai.elimu.entity.content.Word;

import org.springframework.dao.DataAccessException;

import ai.elimu.model.content.multimedia.Image;
import ai.elimu.entity.content.multimedia.Image;

public interface ImageDao extends GenericDao<Image> {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/LetterContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.Letter;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.LetterContributionEvent;
import ai.elimu.entity.content.Letter;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.LetterContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/LetterDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.Letter;
import ai.elimu.entity.content.Letter;

import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/LetterLearningEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.admin.Application;
import ai.elimu.model.analytics.LetterLearningEvent;
import ai.elimu.model.content.Letter;
import ai.elimu.entity.admin.Application;
import ai.elimu.entity.analytics.LetterLearningEvent;
import ai.elimu.entity.content.Letter;
import java.util.Calendar;
import org.springframework.dao.DataAccessException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.LetterSoundCorrespondence;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.LetterSoundCorrespondenceContributionEvent;
import ai.elimu.entity.content.LetterSoundCorrespondence;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.LetterSoundCorrespondenceContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/LetterSoundDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.Sound;
import ai.elimu.model.content.Letter;
import ai.elimu.model.content.LetterSoundCorrespondence;
import ai.elimu.entity.content.Sound;
import ai.elimu.entity.content.Letter;
import ai.elimu.entity.content.LetterSoundCorrespondence;
import java.util.List;

import org.springframework.dao.DataAccessException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.LetterSoundCorrespondence;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.LetterSoundCorrespondenceContributionEvent;
import ai.elimu.model.contributor.LetterSoundCorrespondencePeerReviewEvent;
import ai.elimu.entity.content.LetterSoundCorrespondence;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.LetterSoundCorrespondenceContributionEvent;
import ai.elimu.entity.contributor.LetterSoundCorrespondencePeerReviewEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/NumberContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.Number;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.NumberContributionEvent;
import ai.elimu.entity.content.Number;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.NumberContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/NumberDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import ai.elimu.model.content.Number;
import ai.elimu.entity.content.Number;

import org.springframework.dao.DataAccessException;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ai/elimu/dao/NumberPeerReviewEventDao.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.Number;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.NumberContributionEvent;
import ai.elimu.model.contributor.NumberPeerReviewEvent;
import ai.elimu.entity.content.Number;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.NumberContributionEvent;
import ai.elimu.entity.contributor.NumberPeerReviewEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/SoundContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.Sound;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.SoundContributionEvent;
import ai.elimu.entity.content.Sound;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.SoundContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/SoundDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.Sound;
import ai.elimu.entity.content.Sound;

import org.springframework.dao.DataAccessException;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/elimu/dao/StoryBookChapterDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.StoryBook;
import ai.elimu.model.content.StoryBookChapter;
import ai.elimu.entity.content.StoryBook;
import ai.elimu.entity.content.StoryBookChapter;

import org.springframework.dao.DataAccessException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.StoryBook;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.StoryBookContributionEvent;
import ai.elimu.entity.content.StoryBook;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.StoryBookContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/StoryBookDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.StoryBook;
import ai.elimu.entity.content.StoryBook;

import ai.elimu.model.v2.enums.ReadingLevel;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/StoryBookLearningEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.admin.Application;
import ai.elimu.model.analytics.StoryBookLearningEvent;
import ai.elimu.model.content.StoryBook;
import ai.elimu.entity.admin.Application;
import ai.elimu.entity.analytics.StoryBookLearningEvent;
import ai.elimu.entity.content.StoryBook;
import java.util.Calendar;
import java.util.List;
import org.springframework.dao.DataAccessException;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/elimu/dao/StoryBookParagraphDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.StoryBookChapter;
import ai.elimu.model.content.StoryBookParagraph;
import ai.elimu.entity.content.StoryBookChapter;
import ai.elimu.entity.content.StoryBookParagraph;

import org.springframework.dao.DataAccessException;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ai/elimu/dao/StoryBookPeerReviewEventDao.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.StoryBook;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.StoryBookContributionEvent;
import ai.elimu.model.contributor.StoryBookPeerReviewEvent;
import ai.elimu.entity.content.StoryBook;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.StoryBookContributionEvent;
import ai.elimu.entity.contributor.StoryBookPeerReviewEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/SyllableDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.Syllable;
import ai.elimu.entity.content.Syllable;

import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/VideoDao.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ai.elimu.dao;

import java.util.List;
import ai.elimu.model.content.multimedia.Video;
import ai.elimu.entity.content.multimedia.Video;

import org.springframework.dao.DataAccessException;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/WordContributionEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.content.Word;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.WordContributionEvent;
import ai.elimu.entity.content.Word;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.WordContributionEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/WordDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import ai.elimu.model.content.Word;
import ai.elimu.entity.content.Word;

import ai.elimu.model.v2.enums.content.WordType;
import org.springframework.dao.DataAccessException;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/WordLearningEventDao.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ai.elimu.dao;

import ai.elimu.model.admin.Application;
import ai.elimu.model.analytics.WordLearningEvent;
import ai.elimu.model.content.Word;
import ai.elimu.entity.admin.Application;
import ai.elimu.entity.analytics.WordLearningEvent;
import ai.elimu.entity.content.Word;
import java.util.Calendar;
import org.springframework.dao.DataAccessException;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ai/elimu/dao/WordPeerReviewEventDao.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.elimu.dao;

import ai.elimu.model.content.Word;
import ai.elimu.model.contributor.Contributor;
import ai.elimu.model.contributor.WordContributionEvent;
import ai.elimu.model.contributor.WordPeerReviewEvent;
import ai.elimu.entity.content.Word;
import ai.elimu.entity.contributor.Contributor;
import ai.elimu.entity.contributor.WordContributionEvent;
import ai.elimu.entity.contributor.WordPeerReviewEvent;
import java.util.List;
import org.springframework.dao.DataAccessException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/jpa/ApplicationDaoJpa.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import javax.persistence.NoResultException;
import ai.elimu.dao.ApplicationDao;
import ai.elimu.model.admin.Application;
import ai.elimu.entity.admin.Application;

import org.springframework.dao.DataAccessException;

Expand Down
Loading