Skip to content

Commit

Permalink
Made RESOURCE the default IDType #48
Browse files Browse the repository at this point in the history
  • Loading branch information
timowest committed Sep 8, 2013
1 parent 2cbb754 commit f569321
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 33 deletions.
Expand Up @@ -48,7 +48,7 @@
/**
* @return
*/
IDType value() default IDType.LOCAL;
IDType value() default IDType.RESOURCE;

/**
* Namespace of the mapped ids. When ns is not empty local names will be
Expand Down
Expand Up @@ -4,6 +4,7 @@
import com.mysema.rdfbean.annotations.Context;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

public interface ContextDomain {

Expand All @@ -17,7 +18,7 @@ public interface ContextDomain {
@Context(NS1)
public static class Entity1 {

@Id
@Id(IDType.LOCAL)
String id;

@Predicate
Expand All @@ -39,7 +40,7 @@ public Entity2 getEntity() {
@ClassMapping
public static class Entity2 {

@Id
@Id(IDType.LOCAL)
String id;

@Predicate(context = NS2)
Expand All @@ -61,7 +62,7 @@ public Entity3 getEntity() {
@ClassMapping
public static class Entity3 {

@Id
@Id(IDType.LOCAL)
String id;

@Predicate(context = NS3)
Expand Down
Expand Up @@ -53,7 +53,7 @@ public Entity getRevisionOf() {
@ClassMapping
public static class Entity {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -72,7 +72,7 @@ public Document getDocument() {
@ClassMapping
public static class Document {

@Id
@Id(IDType.LOCAL)
public String id;

public String getId() {
Expand Down
Expand Up @@ -12,12 +12,13 @@
import com.mysema.query.types.path.StringPath;
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.model.IDType;

public interface InferenceDomain {

@ClassMapping
public static class Entity1 {
@Id
@Id(IDType.LOCAL)
public String id;
}

Expand Down
Expand Up @@ -15,12 +15,13 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

public interface LoadDomain {

@ClassMapping
public class Document {
@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -29,7 +30,7 @@ public class Document {

@ClassMapping
public class Entity {
@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -42,7 +43,7 @@ public class Entity {

@ClassMapping
public class Revision {
@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand Down
Expand Up @@ -11,6 +11,7 @@
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.annotations.Properties;
import com.mysema.rdfbean.model.IDType;
import com.mysema.rdfbean.model.NODE;
import com.mysema.rdfbean.model.UID;

Expand All @@ -28,7 +29,7 @@ public interface PropertiesDomain {
@ClassMapping
public static class Person {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -38,7 +39,7 @@ public static class Person {
@ClassMapping
public static class Iteration {

@Id
@Id(IDType.LOCAL)
String id;

@Predicate
Expand All @@ -48,7 +49,7 @@ public static class Iteration {
@ClassMapping
public static class Project {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand Down
Expand Up @@ -29,12 +29,13 @@
import com.mysema.rdfbean.annotations.MapElements;
import com.mysema.rdfbean.annotations.Path;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

public interface SimpleDomain {

@ClassMapping(ns = TEST.NS, ln = "TestType1")
public class SimpleType {
@Id
@Id(IDType.LOCAL)
public String id;

@Predicate(ln = "directProperty1")
Expand Down Expand Up @@ -155,7 +156,7 @@ public void setDateProperty(Date dateProperty) {
@ClassMapping(ns = TEST.NS, ln = "TestType2")
public class SimpleType2 {

@Id
@Id(IDType.LOCAL)
public String id;

@Path({ @Predicate(ln = "testType"), @Predicate(ln = "directProperty") })
Expand Down
Expand Up @@ -8,13 +8,14 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

public interface UserDepartmentCompanyDomain {

@ClassMapping
public static class User {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -40,7 +41,7 @@ public String getUserName() {
@ClassMapping
public static class Department {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -59,7 +60,7 @@ public Company getCompany() {
@ClassMapping
public static class Company {

@Id
@Id(IDType.LOCAL)
public String id;

public String getId() {
Expand Down
Expand Up @@ -11,7 +11,6 @@

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import com.mysema.rdfbean.AbstractConnectionTest;
Expand Down
Expand Up @@ -8,13 +8,14 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;
import com.mysema.rdfbean.model.LID;
import com.mysema.rdfbean.model.MiniRepository;

@ClassMapping
public class ArrayTest {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand Down
Expand Up @@ -13,6 +13,7 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;
import com.mysema.rdfbean.model.MiniRepository;
import com.mysema.rdfbean.model.STMT;
import com.mysema.rdfbean.model.UID;
Expand All @@ -22,7 +23,7 @@ public class ContextTest {
@ClassMapping
public static class Entity {

@Id
@Id(IDType.LOCAL)
String id;

@Predicate
Expand Down
Expand Up @@ -27,12 +27,13 @@
import com.mysema.rdfbean.annotations.ContainerType;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;
import com.mysema.rdfbean.model.MiniRepository;

@ClassMapping
public class DeleteTest {

@Id
@Id(IDType.LOCAL)
private String id;

@Predicate
Expand All @@ -52,7 +53,7 @@ public class DeleteTest {

@ClassMapping(ns = TEST.NS, ln = "DeleteTest")
public static class DeleteDTO {
@Id
@Id(IDType.LOCAL)
String id;

public DeleteDTO() {
Expand Down
Expand Up @@ -10,13 +10,14 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

public class ListContainerTest {

@ClassMapping
public static class Example {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -27,7 +28,7 @@ public static class Example {
@ClassMapping
public static class ChildContainer {

@Id
@Id(IDType.LOCAL)
public String id;

@Predicate
Expand All @@ -38,7 +39,7 @@ public static class ChildContainer {
@ClassMapping
public static class Child {

@Id
@Id(IDType.LOCAL)
public String id;

}
Expand Down
Expand Up @@ -9,20 +9,21 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Mixin;
import com.mysema.rdfbean.model.IDType;

public class MixinIdTest {

@ClassMapping
public static final class AType {
@Mixin
BType asBType = new BType();
@Id
@Id(IDType.LOCAL)
String id;
}

@ClassMapping
public static final class BType {
@Id
@Id(IDType.LOCAL)
String id;
}

Expand Down
Expand Up @@ -14,6 +14,7 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Mixin;
import com.mysema.rdfbean.model.IDType;
import com.mysema.rdfbean.model.LID;

public class MixinTest {
Expand All @@ -22,15 +23,15 @@ public class MixinTest {
public static final class AType {
@Mixin
BType asBType;
@Id
@Id(IDType.LOCAL)
LID id;
}

@ClassMapping
public static final class BType {
@Mixin
AType asAType;
@Id
@Id(IDType.LOCAL)
LID id;
}

Expand Down
Expand Up @@ -10,13 +10,14 @@
import com.mysema.query.alias.Alias;
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.model.IDType;

public class SessionListTest {

@ClassMapping
public static class Example {

@Id
@Id(IDType.LOCAL)
public String id;
}

Expand Down
Expand Up @@ -4,11 +4,12 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

@ClassMapping(ns = DEMO.NS)
public abstract class Party {

@Id
@Id(IDType.LOCAL)
private String id;

public String getId() {
Expand Down
Expand Up @@ -3,11 +3,12 @@
import com.mysema.rdfbean.annotations.ClassMapping;
import com.mysema.rdfbean.annotations.Id;
import com.mysema.rdfbean.annotations.Predicate;
import com.mysema.rdfbean.model.IDType;

@ClassMapping(ns = DEMO.NS)
public abstract class Party {

@Id
@Id(IDType.LOCAL)
private String id;

public String getId() {
Expand Down

0 comments on commit f569321

Please sign in to comment.