MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EmbeddedTest.java
1 /*
2  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 package com.mysql.clusterj.jpatest;
19 
20 import com.mysql.clusterj.jpatest.model.Embedded;
21 import com.mysql.clusterj.jpatest.model.Embedding;
22 import com.mysql.clusterj.jpatest.model.IdBase;
23 
24 
41 @Ignore
42 public class EmbeddedTest extends AbstractJPABaseTest {
43 
44  private int NUMBER_OF_INSTANCES = 10;
45 
46  @Override
47  protected boolean getDebug() {
48  return false;
49  }
50 
52  protected Class<? extends IdBase> getModelClass() {
53  return Embedding.class;
54  }
55 
60  @Override
62  return "ndb";
63  }
64 
65  public void test() {
66  removeAll(Embedding.class);
67  em.getTransaction().begin();
68  for (int i = 0; i < NUMBER_OF_INSTANCES ; ++i) {
69  Embedding e = createEmbedding(i);
70  em.persist(e);
71  }
72  em.getTransaction().commit();
73  }
74 
75  private Embedding createEmbedding(int i) {
76  Embedded embedded = new Embedded();
77  embedded.setAge(i);
78  embedded.setName("Embedded " + i);
79  Embedding embedding = new Embedding();
80  embedding.setId(i);
81  embedding.setMagic(i);
82  embedding.setEmbedded(embedded);
83  return embedding;
84  }
85 
86 }