Consistently use entryId name everywhere
This commit is contained in:
@@ -211,17 +211,17 @@ class Sense extends SQLWritable {
|
||||
}
|
||||
|
||||
class Entry extends SQLWritable {
|
||||
final int id;
|
||||
final int entryId;
|
||||
final List<KanjiElement> kanji;
|
||||
final List<ReadingElement> readings;
|
||||
final List<Sense> senses;
|
||||
|
||||
const Entry({
|
||||
required this.id,
|
||||
required this.entryId,
|
||||
required this.kanji,
|
||||
required this.readings,
|
||||
required this.senses,
|
||||
});
|
||||
|
||||
Map<String, Object?> get sqlValue => {'id': id};
|
||||
Map<String, Object?> get sqlValue => {'entryId': entryId};
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
for (final k in e.kanji) {
|
||||
b.insert(
|
||||
JMdictTableNames.kanjiElement,
|
||||
k.sqlValue..addAll({'entryId': e.id}),
|
||||
k.sqlValue..addAll({'entryId': e.entryId}),
|
||||
);
|
||||
|
||||
for (final i in k.info) {
|
||||
b.insert(
|
||||
JMdictTableNames.kanjiInfo,
|
||||
{
|
||||
'entryId': e.id,
|
||||
'entryId': e.entryId,
|
||||
'reading': k.reading,
|
||||
'info': i,
|
||||
},
|
||||
@@ -95,14 +95,14 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
for (final r in e.readings) {
|
||||
b.insert(
|
||||
JMdictTableNames.readingElement,
|
||||
r.sqlValue..addAll({'entryId': e.id}),
|
||||
r.sqlValue..addAll({'entryId': e.entryId}),
|
||||
);
|
||||
|
||||
for (final i in r.info) {
|
||||
b.insert(
|
||||
JMdictTableNames.readingInfo,
|
||||
{
|
||||
'entryId': e.id,
|
||||
'entryId': e.entryId,
|
||||
'reading': r.reading,
|
||||
'info': i,
|
||||
},
|
||||
@@ -112,7 +112,7 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
b.insert(
|
||||
JMdictTableNames.readingRestriction,
|
||||
{
|
||||
'entryId': e.id,
|
||||
'entryId': e.entryId,
|
||||
'reading': r.reading,
|
||||
'restriction': res,
|
||||
},
|
||||
@@ -128,7 +128,7 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
|
||||
for (final e in entries) {
|
||||
for (final s in e.senses) {
|
||||
b.insert(JMdictTableNames.sense, s.sqlValue..addAll({'entryId': e.id}));
|
||||
b.insert(JMdictTableNames.sense, s.sqlValue..addAll({'entryId': e.entryId}));
|
||||
for (final d in s.dialects) {
|
||||
b.insert(
|
||||
JMdictTableNames.senseDialect,
|
||||
@@ -150,13 +150,13 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
for (final rk in s.restrictedToKanji) {
|
||||
b.insert(
|
||||
JMdictTableNames.senseRestrictedToKanji,
|
||||
{'entryId': e.id, 'senseId': s.id, 'kanji': rk},
|
||||
{'entryId': e.entryId, 'senseId': s.id, 'kanji': rk},
|
||||
);
|
||||
}
|
||||
for (final rr in s.restrictedToReading) {
|
||||
b.insert(
|
||||
JMdictTableNames.senseRestrictedToReading,
|
||||
{'entryId': e.id, 'senseId': s.id, 'reading': rr},
|
||||
{'entryId': e.entryId, 'senseId': s.id, 'reading': rr},
|
||||
);
|
||||
}
|
||||
for (final ls in s.languageSource) {
|
||||
@@ -215,7 +215,7 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
JMdictTableNames.senseSeeAlso,
|
||||
{
|
||||
'senseId': s.id,
|
||||
'xrefEntryId': resolvedEntry.entry.id,
|
||||
'xrefEntryId': resolvedEntry.entry.entryId,
|
||||
'seeAlsoKanji': xref.kanjiRef,
|
||||
'seeAlsoReading': xref.readingRef,
|
||||
'seeAlsoSense': xref.senseOrderNum,
|
||||
@@ -233,7 +233,7 @@ Future<void> seedJMDictData(List<Entry> entries, Database db) async {
|
||||
|
||||
b.insert(JMdictTableNames.senseAntonyms, {
|
||||
'senseId': s.id,
|
||||
'xrefEntryId': resolvedEntry.entry.id,
|
||||
'xrefEntryId': resolvedEntry.entry.entryId,
|
||||
'antonymKanji': ant.kanjiRef,
|
||||
'antonymReading': ant.readingRef,
|
||||
'antonymSense': ant.senseOrderNum,
|
||||
|
||||
@@ -190,7 +190,7 @@ List<Entry> parseJMDictData(XmlElement root) {
|
||||
|
||||
entries.add(
|
||||
Entry(
|
||||
id: entryId,
|
||||
entryId: entryId,
|
||||
kanji: kanjiEls,
|
||||
readings: readingEls,
|
||||
senses: senses,
|
||||
|
||||
Reference in New Issue
Block a user