added test and update to AJ-1.6.12.BUILD-SNAPSHOT for generic node entity classes

This commit is contained in:
Michael Hunger
2011-04-28 09:27:32 +02:00
parent 28c4b8f30c
commit 373b446332
3 changed files with 46 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
<data.commons.version>1.0.0.RELEASE</data.commons.version>
<neo4j.version>1.3</neo4j.version>
<aspectj.version>1.6.11.RELEASE</aspectj.version>
<aspectj.version>1.6.12.BUILD-SNAPSHOT</aspectj.version>
</properties>
<profiles>
<profile>

View File

@@ -0,0 +1,38 @@
/**
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.graph.neo4j;
import org.springframework.data.graph.annotation.NodeEntity;
import org.springframework.data.graph.neo4j.annotation.Indexed;
/**
* @author mh
* @since 27.04.11
*/
@NodeEntity
public class Attribute<T> {
@Indexed
T value;
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
}

View File

@@ -24,6 +24,7 @@ import org.junit.runner.RunWith;
import org.neo4j.graphdb.NotFoundException;
import org.neo4j.graphdb.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.graph.neo4j.Attribute;
import org.springframework.data.graph.neo4j.Group;
import org.springframework.data.graph.neo4j.Person;
import org.springframework.data.graph.neo4j.PersonRepository;
@@ -134,4 +135,10 @@ import static org.springframework.data.graph.neo4j.Person.persistedPerson;
Assert.assertNull("node deleted " + id, graphDatabaseContext.getNodeById(id));
}
@Test
public void testPersistGenericEntity() {
final Attribute<String> attribute = new Attribute<String>();
attribute.setValue("test");
attribute.persist();
}
}