Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
ARSnova Backend
Commits
5f766c98
Commit
5f766c98
authored
6 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Implement ResolvableTypeProvider to circumvent type erasure
parent
125bbf90
1 merge request
!101
CRUD events
Pipeline
#20481
passed with warnings with stages
in 1 minute and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/event/CrudEvent.java
+8
-1
8 additions, 1 deletion
src/main/java/de/thm/arsnova/event/CrudEvent.java
with
8 additions
and
1 deletion
src/main/java/de/thm/arsnova/event/CrudEvent.java
+
8
−
1
View file @
5f766c98
...
...
@@ -2,8 +2,10 @@ package de.thm.arsnova.event;
import
de.thm.arsnova.model.Entity
;
import
org.springframework.context.ApplicationEvent
;
import
org.springframework.core.ResolvableType
;
import
org.springframework.core.ResolvableTypeProvider
;
public
abstract
class
CrudEvent
<
E
extends
Entity
>
extends
ApplicationEvent
{
public
abstract
class
CrudEvent
<
E
extends
Entity
>
extends
ApplicationEvent
implements
ResolvableTypeProvider
{
public
CrudEvent
(
final
E
source
)
{
super
(
source
);
}
...
...
@@ -12,4 +14,9 @@ public abstract class CrudEvent<E extends Entity> extends ApplicationEvent {
public
E
getSource
()
{
return
(
E
)
super
.
getSource
();
}
@Override
public
ResolvableType
getResolvableType
()
{
return
ResolvableType
.
forClassWithGenerics
(
getClass
(),
source
.
getClass
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment