Package com.avaje.ebeaninternal.api

Examples of com.avaje.ebeaninternal.api.SpiEbeanServer


  @Test
  public void test() {
   
    EbeanServer server = Ebean.getServer(null);
    SpiEbeanServer spiServer = (SpiEbeanServer)server;
   
    boolean seqSupport = spiServer.getDatabasePlatform().getDbIdentity().isSupportsSequence();
   
    if (seqSupport){
      BeanDescriptor<TOne> d = spiServer.getBeanDescriptor(TOne.class);
 
      Object id = d.nextId(null);
      Assert.assertNotNull(id);
     
      for (int i = 0; i < 16; i++) {
View Full Code Here


    Customer c0 = new Customer();
    c0.setBillingAddress(a);

    Customer c1 = new Customer();

    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    BeanDescriptor<Customer> descriptor = server.getBeanDescriptor(Customer.class);

    ElPropertyValue elProp = descriptor.getElGetValue("billingAddress.id");
    ElPropertyValue addrLine1Prop = descriptor.getElGetValue("billingAddress.line1");
    ElPropertyValue addrCityProp = descriptor.getElGetValue("billingAddress.city");
   
View Full Code Here

public class TestELBasic extends BaseTestCase {

  @Test
  public void testEl() {
   
    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    BeanDescriptor<Customer> descriptor = server.getBeanDescriptor(Customer.class);
   
    ElPropertyDeploy elId = descriptor.getElPropertyDeploy("id");
    Assert.assertTrue(elId instanceof BeanProperty);
   
    ElPropertyDeploy elBillAddress = descriptor.getElPropertyDeploy("billingAddress");
View Full Code Here

  }
 
  @Test public void testFindByParentIdList() {
    assertEquals(2, Ebean.find(User.class).findList().size());
   
    SpiEbeanServer spiServer = (SpiEbeanServer)Ebean.getServer(null);
   
    BeanDescriptor<TestOnCascadeDeleteChildrenWithCompositeKeys.User> beanDescriptor =
        spiServer.getBeanDescriptor(TestOnCascadeDeleteChildrenWithCompositeKeys.User.class);
   
    BeanPropertyAssocMany<?> beanProperty = (BeanPropertyAssocMany<?>)beanDescriptor.getBeanProperty("userRoles");

    List<Object> ids = new ArrayList<Object>();
    ids.add(1L);
View Full Code Here

     * <p/>
     * Notice: Actually, this test depends on H2 as used database as we are going to fetch the current value from the sequence
     */
    public void testSequence() throws SQLException
    {
      SpiEbeanServer server = (SpiEbeanServer)getServer();
      IdType idType = server.getDatabasePlatform().getDbIdentity().getIdType();
      String platformName = server.getDatabasePlatform().getName();
      if (!IdType.SEQUENCE.equals(idType)){
        // only run this test when SEQUENCE is being used
        return;
      }
      if (!"h2".equals(platformName)){
View Full Code Here

     * EBean should simply fetch the generated key after inserting.
     */
    public void testIdentity() throws SQLException
    {

      SpiEbeanServer server = (SpiEbeanServer)getServer();
      IdType idType = server.getDatabasePlatform().getDbIdentity().getIdType();
     
      if (!IdType.IDENTITY.equals(idType)){
        // only run this test when SEQUENCE is being used
        return;
      }
View Full Code Here

  @Test
  public void test() {
   
    ResetBasicData.reset();
   
    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
   
    BeanDescriptor<Order> descOrder = server.getBeanDescriptor(Order.class);
    BeanPropertyAssocMany<?> beanProperty = (BeanPropertyAssocMany<?>)descOrder.getBeanProperty("details");
   
    List<Object> parentIds = new ArrayList<Object>();
    parentIds.add(1);
   
View Full Code Here

        p.setFirstName("first");
        p.setLastName("last");
        p.setSalary(new Money("12200"));
        p.setCmoney(new CMoney(new Money("12"), NZD));
       
        SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
       
        BeanDescriptor<DPerson> descriptor = server.getBeanDescriptor(DPerson.class);
       
        ElPropertyValue elCmoney = descriptor.getElGetValue("cmoney");
//        ElPropertyValue elCmoneyAmt = descriptor.getElGetValue("cmoney.amount");
//        ElPropertyValue elCmoneyCur = descriptor.getElGetValue("cmoney.currency");
       
        JsonContext jsonContext = server.json();
        String json = jsonContext.toJson(p);
       
        DPerson bean = jsonContext.toBean(DPerson.class, json);
        Assert.assertEquals("first", bean.getFirstName());
        Assert.assertEquals(new Money("12200"), bean.getSalary());
View Full Code Here

public class TestJodaType extends BaseTestCase {

  @Test
  public void test() {
   
    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    BeanDescriptor<TJodaEntity> beanDescriptor = server.getBeanDescriptor(TJodaEntity.class);
    BeanProperty beanProperty = beanDescriptor.getBeanProperty("localTime");
    ScalarType<?> scalarType = beanProperty.getScalarType();
   
    Assert.assertNotNull(scalarType);
  }
View Full Code Here

  @Test
  public void testMaxRowsZeroWithFirstRow() {
    ResetBasicData.reset();

    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    boolean h2Db = "h2".equals(server.getDatabasePlatform().getName());

    Query<Order> query = Ebean.find(Order.class)
      .setAutofetch(false)
      .fetch("details")
      .where().gt("details.id", 0)
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.api.SpiEbeanServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.