Skip to content

Commit

Permalink
Added "text" and "format" fields to Content table and related classes (
Browse files Browse the repository at this point in the history
  • Loading branch information
KJoslyn authored and jsarabia committed Feb 1, 2019
1 parent c531d56 commit 35c028f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ class ContentDao(
CONTENT_ENTITY.SORT,
CONTENT_ENTITY.START,
CONTENT_ENTITY.LABEL,
CONTENT_ENTITY.SELECTED_TAKE_FK
CONTENT_ENTITY.SELECTED_TAKE_FK,
CONTENT_ENTITY.TEXT,
CONTENT_ENTITY.FORMAT
)
.values(
entity.collectionFk,
entity.sort,
entity.start,
entity.labelKey,
entity.selectedTakeFk
entity.selectedTakeFk,
entity.text,
entity.format
)
.execute()

Expand Down Expand Up @@ -115,6 +119,8 @@ class ContentDao(
.set(CONTENT_ENTITY.START, entity.start)
.set(CONTENT_ENTITY.COLLECTION_FK, entity.collectionFk)
.set(CONTENT_ENTITY.SELECTED_TAKE_FK, entity.selectedTakeFk)
.set(CONTENT_ENTITY.TEXT, entity.text)
.set(CONTENT_ENTITY.FORMAT, entity.format)
.where(CONTENT_ENTITY.ID.eq(entity.id))
.execute()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class RecordMappers {
record.getValue(CONTENT_ENTITY.LABEL),
record.getValue(CONTENT_ENTITY.START),
record.getValue(CONTENT_ENTITY.COLLECTION_FK),
record.getValue(CONTENT_ENTITY.SELECTED_TAKE_FK)
record.getValue(CONTENT_ENTITY.SELECTED_TAKE_FK),
record.getValue(CONTENT_ENTITY.TEXT),
record.getValue(CONTENT_ENTITY.FORMAT)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ data class ContentEntity(
var labelKey: String,
var start: Int,
var collectionFk: Int,
var selectedTakeFk: Int?
var selectedTakeFk: Int?,
var text: String?,
var format: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class ContentMapper {
entity.start,
end,
selectedTake,
entity.text,
entity.format,
entity.id
)
}
Expand All @@ -23,7 +25,9 @@ class ContentMapper {
obj.labelKey,
obj.start,
collectionFk,
obj.selectedTake?.id
obj.selectedTake?.id,
obj.text,
obj.format
)
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/sql/CreateAppDb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ CREATE TABLE IF NOT EXISTS content_entity (
label TEXT NOT NULL,
selected_take_fk INTEGER REFERENCES take_entity(id),
start INTEGER NOT NULL,
sort INTEGER NOT NULL
sort INTEGER NOT NULL,
text TEXT,
format TEXT
);

CREATE TABLE IF NOT EXISTS content_derivative (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ object TestDataStore {
"verse1",
1,
1,
null,
null,
null
),
Content(
41,
"verse42",
42,
42,
takes.first()
takes.first(),
null,
null
)
)
}

0 comments on commit 35c028f

Please sign in to comment.