Last active
August 29, 2015 14:01
-
-
Save jhiemer/f95ca403dc849692f482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Document | |
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, | |
property = "@class") | |
public class ChildOne extends Parent { | |
private long up; | |
private long down; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Document | |
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, | |
property = "@class") | |
public class ChildTwo extends ChildOne { | |
private long timespan; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class") | |
@JsonSubTypes({ | |
@JsonSubTypes.Type(value = ChildOne.class), | |
@JsonSubTypes.Type(value = ChildTwo .class) | |
}) | |
public class Parent extends AbstractDocument { | |
private String blu; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment