-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add Scope features #643
Add Scope features #643
Conversation
|
||
VariableElement firstParameter = m.getParameters().get(0); | ||
// TODO: この時点ではmetamodelが作られていないので代入可能かのチェックができない。SimpleNameの比較をしているが名前空間がちがえばすり抜けるため他の良い方法があれば | ||
return firstParameter.asType().toString().equals(metamodel.getSimpleName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, type checking cannot be performed correctly because it is before the Metamodel is generated.
Do you have a good idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea.
But I think it's OK.
Thanks. I'll review your pull request this weekend. By the way, your sample code in the "After" section looks wrong. class UserScope {
public Consumer<WhereDeclaration> onlyAdult(UserEntity_ e) {
return w -> w.gt(e.age, 18);
}
public Consumer<WhereDeclaration> onlyCustomer(UserEntity_ e) {
return w -> { w.eq(e.role, "customer");
}
} |
Exactly. I'll fix it. |
...processor/src/main/java/org/seasar/doma/internal/apt/generator/EntityMetamodelGenerator.java
Outdated
Show resolved
Hide resolved
doma-processor/src/main/java/org/seasar/doma/internal/apt/decl/TypeDeclaration.java
Outdated
Show resolved
Hide resolved
...processor/src/main/java/org/seasar/doma/internal/apt/generator/EntityMetamodelGenerator.java
Outdated
Show resolved
Hide resolved
doma-processor/src/main/java/org/seasar/doma/internal/apt/meta/entity/EntityMetaScope.java
Outdated
Show resolved
Hide resolved
doma-processor/src/main/java/org/seasar/doma/internal/apt/meta/entity/EntityMetaScope.java
Outdated
Show resolved
Hide resolved
doma-processor/src/main/java/org/seasar/doma/internal/apt/meta/entity/EntityMetaScope.java
Outdated
Show resolved
Hide resolved
@nakamura-to Please review. |
Hi, I will review this weekend. |
@orekyuu Thanks for your changes! |
refs: #641
Before
Until now there has been a need to write code that is not DRY.
example:
After
Extend metamodel annotations to prevent non-DRY code.
Scope Class specifications