Skip to content

Commit cdf8401

Browse files
committed
docs typos & generator future compatibility fix
1 parent f3762b9 commit cdf8401

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

generator/lib/src/entity_resolver.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ class EntityResolver extends Builder {
153153
" invalid relation property '${f.name}' in entity '${element.name}' - must use ToOne/ToMany<TargetEntity>");
154154
continue;
155155
}
156-
relTargetName = (f.type as ParameterizedType)
157-
.typeArguments[0]
158-
.getDisplayString(withNullability: false);
156+
relTargetName =
157+
(f.type as ParameterizedType).typeArguments[0].element.name;
159158
}
160159

161160
if (_backlinkChecker.hasAnnotationOfExact(f)) {

objectbox/lib/src/annotations.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// Entity annotation is used to on a class to let ObjectBox know it should
2-
/// store it - making the class a "persistable Entity".
1+
/// Entity annotation is used on a class to let ObjectBox know it should store
2+
/// it - making the class a "persistable Entity".
33
///
44
/// This annotation is matched by ObjectBox code generator when you call
55
/// `pub run_build_runner build`. The generator creates `objectbox.g.dart` with
@@ -21,10 +21,8 @@ class Entity {
2121
const Entity({this.uid});
2222
}
2323

24-
/// Property annotation enables you to explicitly specify configure some details
25-
/// about how a field is stored in the database.
26-
///
27-
/// Use PropertyType and OBXPropertyFlag values, resp. for type and flag.
24+
/// Property annotation enables you to explicitly configure some details about
25+
/// how a field is stored in the database.
2826
class Property {
2927
/// ObjectBox keeps track of entities and properties by assigning them unique
3028
/// identifiers, UIDs, during the code-generation phase. All those UIDs are
@@ -111,7 +109,7 @@ class Id {
111109
const Id();
112110
}
113111

114-
/// Transient annotation marks properties that should not be stored in the DB.
112+
/// Transient annotation marks fields that should not be stored in the database.
115113
class Transient {
116114
/// Create a Transient annotation.
117115
const Transient();
@@ -135,7 +133,7 @@ class Index {
135133
/// Index type.
136134
final IndexType /*?*/ type;
137135

138-
/// Create an Index annotaion.
136+
/// Create an Index annotation.
139137
const Index({this.type});
140138
}
141139

@@ -153,8 +151,7 @@ enum IndexType {
153151
/// it's default, [hash].
154152
value,
155153

156-
/// Uses a 32-bit hash of the field value to build the index. This is a
157-
/// default for [String] properties.
154+
/// Uses a 32-bit hash of the field value; default for [String] properties.
158155
///
159156
/// Hash collisions should be sporadic and shouldn't impact performance in
160157
/// practice. Because it requires less storage space, it's usually a better

objectbox/lib/src/observable.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class _Observable {
6363
}
6464

6565
/// Streamable adds stream support to queries. The stream reruns the query
66-
/// whenever there's a change in any of the object in the queried Entity
66+
/// whenever there's a change in any of the objects in the queried Box
6767
/// (regardless of the filter conditions).
6868
extension Streamable<T> on Query<T> {
6969
void _setup() {
@@ -79,8 +79,8 @@ extension Streamable<T> on Query<T> {
7979
};
8080
}
8181

82-
/// Create a stream, executing [Query.find()] whenever there's a change to the
83-
/// underlying Entity.
82+
/// Create a stream, executing [Query.find()] whenever there's a change to any
83+
/// of the objects in the queried Box.
8484
Stream<List<T>> findStream(
8585
{@Deprecated('Use offset() instead') int offset = 0,
8686
@Deprecated('Use limit() instead') int limit = 0}) {

objectbox/lib/src/relations/to_one.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ToOne<EntityT> {
115115
}
116116
}
117117

118-
/// Whether the relatin field has a value stored. Otherwise it's null.
118+
/// Whether the relation field has a value stored. Otherwise it's null.
119119
bool get hasValue => _value._state != _ToOneState.none;
120120

121121
/// Initialize the relation field, attaching it to the store.

0 commit comments

Comments
 (0)