DATAGRAPH-430 Deprecate Legacy Index APIs

This commit is contained in:
Michael Hunger
2014-02-24 11:39:33 +01:00
parent 264e7825da
commit f4994afd2e
12 changed files with 32 additions and 46 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.neo4j.partial;
package org.springframework.data.neo4j.partial.model;
/**
* @author Michael Hunger

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.neo4j.partial;
package org.springframework.data.neo4j.partial.model;
import org.springframework.data.neo4j.annotation.EndNode;
import org.springframework.data.neo4j.annotation.RelationshipEntity;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.neo4j.partial;
package org.springframework.data.neo4j.partial.model;
import org.springframework.data.neo4j.annotation.GraphProperty;
import org.springframework.data.neo4j.annotation.Indexed;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.neo4j.partial;
package org.springframework.data.neo4j.partial.model;
import org.springframework.data.neo4j.annotation.*;

View File

@@ -79,5 +79,5 @@ public @interface Indexed {
}
}
enum Level { GLOBAL, CLASS, INSTANCE}
enum Level { @Deprecated GLOBAL, CLASS, INSTANCE}
}

View File

@@ -170,6 +170,7 @@ public abstract class AbstractGraphRepository<S extends PropertyContainer, T> im
* @return Single Entity with this property and value
*/
@Override
@Deprecated
public T findByPropertyValue(final String indexName, final String property, final Object value) {
return legacyIndexSearcher.findByPropertyValue(indexName, property, value);
@@ -184,6 +185,7 @@ public abstract class AbstractGraphRepository<S extends PropertyContainer, T> im
* @return Iterable over Entities with this property and value
*/
@Override
@Deprecated
public EndResult<T> findAllByPropertyValue(final String indexName, final String property, final Object value) {
return legacyIndexSearcher.findAllByPropertyValue(indexName, property, value);
}
@@ -206,6 +208,7 @@ public abstract class AbstractGraphRepository<S extends PropertyContainer, T> im
*@param query lucene query object or query-string @return Iterable over Entities with this property and value
*/
@Override
@Deprecated
public EndResult<T> findAllByQuery(final String key, final Object query) {
return findAllByQuery(null, key,query);
}
@@ -217,15 +220,18 @@ public abstract class AbstractGraphRepository<S extends PropertyContainer, T> im
*@param query lucene query object or query-string @return Iterable over Entities with this property and value
*/
@Override
@Deprecated
public EndResult<T> findAllByQuery(final String indexName, final String property, final Object query) {
return legacyIndexSearcher.findAllByQuery(indexName, property, query);
}
@Override
@Deprecated
public EndResult<T> findAllByRange(final String property, final Number from, final Number to) {
return findAllByRange(null,property,from,to);
}
@Override
@Deprecated
public EndResult<T> findAllByRange(final String indexName, final String property, final Number from, final Number to) {
return legacyIndexSearcher.findAllByRange(indexName, property, from, to);
}

View File

@@ -24,17 +24,17 @@ import org.springframework.transaction.annotation.Transactional;
* @author mh
* @since 29.03.11
*/
public interface IndexRepository<T> {
@Transactional
@Deprecated public interface IndexRepository<T> {
@Transactional @Deprecated
T findByPropertyValue(String property, Object value);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByPropertyValue(String property, Object value);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByQuery(String key, Object query);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByRange(String property, Number from, Number to);
}

View File

@@ -18,6 +18,7 @@ import org.springframework.data.neo4j.support.index.NullReadableIndex;
* @author mh
* @since 01.02.14
*/
@Deprecated
public class LegacyIndexSearcher<S extends PropertyContainer,T> {
private final Neo4jTemplate template;
private final Class<T> clazz;

View File

@@ -24,17 +24,17 @@ import org.springframework.transaction.annotation.Transactional;
* @author mh
* @since 29.03.11
*/
public interface NamedIndexRepository<T> {
@Transactional
@Deprecated public interface NamedIndexRepository<T> {
@Transactional @Deprecated
T findByPropertyValue(String indexName, String property, Object value);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByPropertyValue(String indexName, String property, Object value);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByQuery(String indexName, String key, Object query);
@Transactional
@Transactional @Deprecated
EndResult<T> findAllByRange(String indexName, String property, Number from, Number to);
}

View File

@@ -20,35 +20,36 @@ import org.neo4j.graphdb.index.Index;
import org.springframework.data.neo4j.mapping.Neo4jPersistentEntity;
import org.springframework.data.neo4j.mapping.Neo4jPersistentProperty;
@Deprecated
public interface IndexProvider {
<S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> type);
@Deprecated <S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> type);
<S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> type, String indexName);
@Deprecated <S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> type, String indexName);
@SuppressWarnings("unchecked")
<S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> persistentEntity, String indexName, IndexType indexType);
@Deprecated <S extends PropertyContainer, T> Index<S> getIndex(Neo4jPersistentEntity<T> persistentEntity, String indexName, IndexType indexType);
<T extends PropertyContainer> Index<T> getIndex(String indexName);
@Deprecated <T extends PropertyContainer> Index<T> getIndex(String indexName);
boolean isNode(Class<? extends PropertyContainer> type);
// TODO handle existing indexes
@SuppressWarnings("unchecked")
<T extends PropertyContainer> Index<T> createIndex(Class<T> propertyContainerType, String indexName,
@Deprecated <T extends PropertyContainer> Index<T> createIndex(Class<T> propertyContainerType, String indexName,
IndexType fullText);
<S extends PropertyContainer> Index<S> getIndex(Neo4jPersistentProperty property, final Class<?> instanceType);
@Deprecated <S extends PropertyContainer> Index<S> getIndex(Neo4jPersistentProperty property, final Class<?> instanceType);
/**
* adjust your indexName for the "__types__" indices
*
* @return prefixed indexName for Type
*/
String createIndexValueForType(Object type);
@Deprecated String createIndexValueForType(Object type);
/**
* possibility to do something with the high level index name
*/
String customizeIndexName(String indexName, Class<?> type);
@Deprecated String customizeIndexName(String indexName, Class<?> type);
}

View File

@@ -23,6 +23,7 @@ import java.util.Map;
public enum IndexType
{
@Deprecated
SIMPLE { public Map<String,String> getConfig() { return LuceneIndexImplementation.EXACT_CONFIG; } },
LABEL { public Map<String,String> getConfig() { return null; } public boolean isLabelBased() { return true; }},
FULLTEXT { public Map<String,String> getConfig() { return LuceneIndexImplementation.FULLTEXT_CONFIG; } },

View File

@@ -1,23 +0,0 @@
/**
* 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.neo4j.model;
import org.springframework.data.neo4j.annotation.NodeEntity;
@NodeEntity
public class SubGroup extends Group {
}