-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from kbss-cvut/development
[0.21.0] release
- Loading branch information
Showing
68 changed files
with
1,333 additions
and
352 deletions.
There are no files selected for viewing
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
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
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
29 changes: 29 additions & 0 deletions
29
jopa-api/src/main/java/cz/cvut/kbss/jopa/model/annotations/EnumType.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cz.cvut.kbss.jopa.model.annotations; | ||
|
||
/** | ||
* Defines mapping for enumerated types. | ||
* <p> | ||
* The constants of this enumerated type specify how a persistent property or field of an enumerated type should be | ||
* persisted. | ||
*/ | ||
public enum EnumType { | ||
/** | ||
* Persist enumerated type property or field as an individual assumed to be an element of a {@literal | ||
* owl:ObjectOneOf} enumeration. | ||
* <p> | ||
* Note that in this case the enum constants must be annotated with {@link Individual} mapping them to ontological | ||
* individuals. | ||
*/ | ||
OBJECT_ONE_OF, | ||
|
||
/** | ||
* Persist enumerated type property or field as an integer representing the ordinal number of the enumerated | ||
* constant. | ||
*/ | ||
ORDINAL, | ||
|
||
/** | ||
* Persist enumerated type property or field as a string representation of the enumerated constant. | ||
*/ | ||
STRING | ||
} |
22 changes: 22 additions & 0 deletions
22
jopa-api/src/main/java/cz/cvut/kbss/jopa/model/annotations/Enumerated.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cz.cvut.kbss.jopa.model.annotations; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Specifies that a persistent property or field should be persisted as an enumerated type. | ||
* <p> | ||
* If the enumerated type is not specified or the Enumerated annotation is not used, the EnumType value is assumed to be | ||
* {@code STRING}. | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface Enumerated { | ||
|
||
/** | ||
* (Optional) The type used in mapping an enum type. | ||
* | ||
* @return Enum mapping type | ||
*/ | ||
EnumType value() default EnumType.STRING; | ||
} |
19 changes: 19 additions & 0 deletions
19
jopa-api/src/main/java/cz/cvut/kbss/jopa/model/annotations/Individual.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cz.cvut.kbss.jopa.model.annotations; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* Represents an OWL individual (or an RDF resource) identified by the specified IRI. | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface Individual { | ||
|
||
/** | ||
* Identifier of this individual. | ||
* | ||
* @return IRI as string | ||
*/ | ||
String iri(); | ||
} |
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
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
11 changes: 11 additions & 0 deletions
11
jopa-impl/src/main/java/cz/cvut/kbss/jopa/exception/InvalidEnumMappingException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package cz.cvut.kbss.jopa.exception; | ||
|
||
/** | ||
* Indicates that an enum mapping is not valid. | ||
*/ | ||
public class InvalidEnumMappingException extends MetamodelInitializationException { | ||
|
||
public InvalidEnumMappingException(String message) { | ||
super(message); | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.