Skip to content

Conversation

Buggaboo
Copy link
Contributor

Fix for #92

@Buggaboo Buggaboo changed the title @Transient field ignorer annotation Transient field ignorer annotation Apr 1, 2020
Copy link
Contributor

@vaind vaind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please consider the suggestions

Copy link

@lzhAndroid lzhAndroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the entity override hashCode ,@transent is invalid

@Buggaboo
Copy link
Contributor Author

if the entity override hashCode ,@transent is invalid

Could you give an example?

@lzhAndroid
Copy link

lzhAndroid commented May 18, 2020

if the entity override hashCode ,@transent is invalid

Could you give an example?

import 'package:objectbox/objectbox.dart';

@entity()
class TagEntity {
@id()
int id;

@OverRide
operator ==(tag) {
return true;
}

@OverRide
@transient()
int get hashCode => this.id.hashCode;
}

@Buggaboo
Copy link
Contributor Author

if the entity override hashCode ,@transent is invalid

Could you give an example?

import 'package:objectbox/objectbox.dart';

@entity()
class TagEntity {
@id()
int id;

@OverRide
operator ==(tag) {
return true;
}

@OverRide
@transient()
int get hashCode => this.id.hashCode;
}

Why would you want to apply the Transient property on a getter (hashCode property)? The getters, will be ignored by design.

@greenrobot-team greenrobot-team merged commit 2bafa98 into objectbox:dev Jun 22, 2020
@greenrobot-team
Copy link
Member

LGTM. Thanks again for this, merged! Making some small follow-up tweaks to README and to satisfy linter.

@Buggaboo Buggaboo deleted the transient-ignore-92 branch July 17, 2020 03:43
@vaind vaind mentioned this pull request Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants