/tests/com/google/appengine/datanucleus/BaseDatastoreServiceDelegate.java

http://datanucleus-appengine.googlecode.com/ · Java · 140 lines · 93 code · 29 blank · 18 comment · 0 complexity · 23e5960a5a3c66f897462ccdc22a1c72 MD5 · raw file

  1. /**********************************************************************
  2. Copyright (c) 2009 Google Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. **********************************************************************/
  13. package com.google.appengine.datanucleus;
  14. import com.google.appengine.api.datastore.DatastoreAttributes;
  15. import com.google.appengine.api.datastore.DatastoreService;
  16. import com.google.appengine.api.datastore.Entity;
  17. import com.google.appengine.api.datastore.EntityNotFoundException;
  18. import com.google.appengine.api.datastore.Index;
  19. import com.google.appengine.api.datastore.Key;
  20. import com.google.appengine.api.datastore.KeyRange;
  21. import com.google.appengine.api.datastore.PreparedQuery;
  22. import com.google.appengine.api.datastore.Query;
  23. import com.google.appengine.api.datastore.Transaction;
  24. import com.google.appengine.api.datastore.TransactionOptions;
  25. import java.util.Collection;
  26. import java.util.List;
  27. import java.util.Map;
  28. /**
  29. * @author Max Ross <maxr@google.com>
  30. */
  31. public class BaseDatastoreServiceDelegate implements DatastoreService {
  32. private final DatastoreService delegate;
  33. public BaseDatastoreServiceDelegate(DatastoreService delegate) {
  34. this.delegate = delegate;
  35. }
  36. public Entity get(Key key) throws EntityNotFoundException {
  37. return delegate.get(key);
  38. }
  39. public Entity get(Transaction transaction, Key key) throws EntityNotFoundException {
  40. return delegate.get(transaction, key);
  41. }
  42. public Map<Key, Entity> get(Iterable<Key> keyIterable) {
  43. return delegate.get(keyIterable);
  44. }
  45. public Map<Key, Entity> get(Transaction transaction, Iterable<Key> keyIterable) {
  46. return delegate.get(transaction, keyIterable);
  47. }
  48. public Key put(Entity entity) {
  49. return delegate.put(entity);
  50. }
  51. public Key put(Transaction transaction, Entity entity) {
  52. return delegate.put(transaction, entity);
  53. }
  54. public List<Key> put(Iterable<Entity> entityIterable) {
  55. return delegate.put(entityIterable);
  56. }
  57. public List<Key> put(Transaction transaction, Iterable<Entity> entityIterable) {
  58. return delegate.put(transaction, entityIterable);
  59. }
  60. public void delete(Key... keys) {
  61. delegate.delete(keys);
  62. }
  63. public void delete(Transaction transaction, Key... keys) {
  64. delegate.delete(transaction, keys);
  65. }
  66. public void delete(Iterable<Key> keyIterable) {
  67. delegate.delete(keyIterable);
  68. }
  69. public void delete(Transaction transaction, Iterable<Key> keyIterable) {
  70. delegate.delete(transaction, keyIterable);
  71. }
  72. public PreparedQuery prepare(Query query) {
  73. return delegate.prepare(query);
  74. }
  75. public PreparedQuery prepare(Transaction transaction, Query query) {
  76. return delegate.prepare(transaction, query);
  77. }
  78. public Transaction beginTransaction() {
  79. return delegate.beginTransaction();
  80. }
  81. public Transaction beginTransaction(TransactionOptions txnOpts) {
  82. return delegate.beginTransaction(txnOpts);
  83. }
  84. public Transaction getCurrentTransaction() {
  85. return delegate.getCurrentTransaction();
  86. }
  87. public Transaction getCurrentTransaction(Transaction transaction) {
  88. return delegate.getCurrentTransaction(transaction);
  89. }
  90. public Collection<Transaction> getActiveTransactions() {
  91. return delegate.getActiveTransactions();
  92. }
  93. public KeyRange allocateIds(String s, long l) {
  94. return delegate.allocateIds(s, l);
  95. }
  96. public KeyRange allocateIds(Key key, String s, long l) {
  97. return delegate.allocateIds(key, s, l);
  98. }
  99. public KeyRangeState allocateIdRange(KeyRange keyRange) {
  100. return delegate.allocateIdRange(keyRange);
  101. }
  102. public DatastoreAttributes getDatastoreAttributes() {
  103. return delegate.getDatastoreAttributes();
  104. }
  105. public Map<Index, Index.IndexState> getIndexes() {
  106. return delegate.getIndexes();
  107. }
  108. }