#919 - io.ebean package initial

This commit is contained in:
Rob Bygrave
2016-12-11 23:23:22 +13:00
parent 5821dc96b9
commit 971e2dc91b
2134 changed files with 10721 additions and 8652 deletions
@@ -0,0 +1,33 @@
package org.tests.idkeys;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import org.tests.model.basic.ECustomId;
import org.avaje.moduuid.ModUUID;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class TestCustomId extends BaseTestCase {
@Test
public void insert() {
ECustomId bean = new ECustomId("fred");
Ebean.save(bean);
assertNotNull(bean.getId());
}
@Test
public void insert_when_hasValue() {
ECustomId bean = new ECustomId("gotId");
String explicitId = ModUUID.newShortId();
bean.setId(explicitId);
Ebean.save(bean);
ECustomId found = Ebean.find(ECustomId.class, explicitId);
assertEquals(found.getName(), bean.getName());
}
}