Package com.rapleaf.jack.test_project.database_1.models

Examples of com.rapleaf.jack.test_project.database_1.models.Post$Attributes


  public void testGroupBy(IDatabases dbs) throws IOException, SQLException {
    IUserPersistence users = dbs.getDatabase1().users();
    users.deleteAll();

    for (int i = 0; i < 100; i++) {
      User user = users.createDefaultInstance().setHandle(String.valueOf(i % 2)).setNumPosts(i);
      user.save();
    }

    List<User> result;

    // Test Max
View Full Code Here


  }

  // this test is duplicated because of some weirdness with single quote escaping that appears contstrained to the mock mysql.
  public void testFindAllWithEscapedQuotesInStrings() throws Exception {
    IUserPersistence users = dbs.getDatabase1().users();
    User u1 = users.create("brya'nd", System.currentTimeMillis(), 5, System.currentTimeMillis() + 10, System.currentTimeMillis() + 20, "this is a relatively long string", new byte[]{5, 4, 3, 2, 1}, 1.2d, 3.4d, true);
    User u2 = users.create("thoma\"sk", null, 5, System.currentTimeMillis() + 10, System.currentTimeMillis() + 20, "this is a relatively long string", new byte[]{5, 4, 3, 2, 1}, 1.2d, 3.4d, true);

    assertEquals(Collections.singleton(u1), users.findAll("handle = 'brya\\'nd'"));
    assertEquals(Collections.singleton(u2), users.findAll("handle = 'thoma\"sk'"));
    assertEquals(Collections.singleton(u1), users.findAll("handle = 'brya\\'nd'"));
    assertEquals(Collections.singleton(u2), users.findAll("handle = 'thoma\"sk'"));
View Full Code Here

  @Override
  public void setUp() {
    dbs = new DatabasesImpl(DATABASE_CONNECTION1);
    postModel = new Post(0, "Test Post", 100l, 1, 0l);
    imageModel = new Image(0, null, dbs);
    userModel = new User(0l, "handle", 0l, 0, 0l, 0l, "bio", null, 0.0, 0.0, true);
    try {
      dbs.getDatabase1().deleteAll();
      dbs.getDatabase1().users().save(userModel);
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

  public Set<Image> findByUserId(final Integer value) throws IOException {
    return find(new HashMap<Enum, Object>(){{put(Image._Fields.user_id, value);}});
  }

  public ImageQueryBuilder query() {
    return new ImageQueryBuilder(this);
  }
View Full Code Here

  public Set<Post> findByUpdatedAt(final Long value) throws IOException {
    return find(new HashMap<Enum, Object>(){{put(Post._Fields.updated_at, value);}});
  }

  public PostQueryBuilder query() {
    return new PostQueryBuilder(this);
  }
View Full Code Here

  public Set<User> findBySomeBoolean(final Boolean value) throws IOException {
    return find(new HashMap<Enum, Object>(){{put(User._Fields.some_boolean, value);}});
  }

  public UserQueryBuilder query() {
    return new UserQueryBuilder(this);
  }
View Full Code Here

  public RemoveStandardAttributes(final Attributes controlAttributesParam) {
    controlAttributes = controlAttributesParam;
  }

  public Attributes removeStandard() {
    Attributes attributes = new Attributes(controlAttributes);
    attributes.remove("id");
    attributes.remove("height");
    attributes.remove("width");
    attributes.remove("x");
    attributes.remove("y");
    attributes.remove("align");
    attributes.remove("valign");
    attributes.remove("paddingLeft");
    attributes.remove("paddingRight");
    attributes.remove("paddingTop");
    attributes.remove("paddingBottom");
    attributes.remove("padding");
    attributes.remove("childClip");
    attributes.remove("visible");
    attributes.remove("visibleToMouse");
    attributes.remove("childLayout");
    attributes.remove("focusable");
    attributes.remove("filename");
    attributes.remove("filter");
    attributes.remove("imageMode");
    attributes.remove("inset");
    attributes.remove("backgroundColor");
    attributes.remove("backgroundImage");
    attributes.remove("font");
    attributes.remove("textHAlign");
    attributes.remove("textVAlign");
    attributes.remove("color");
    attributes.remove("selectionColor");
    attributes.remove("name");
    return attributes;
  }
View Full Code Here

  public void materialize(
      final Nifty nifty,
      final Element element,
      final Screen screen,
      final LinkedList < Object > controllers) {
    Attributes attributes = getAttributes();
    initEffect(EffectEventId.onStartScreen, onStartScreen, element, nifty, screen, attributes, controllers);
    initEffect(EffectEventId.onEndScreen, onEndScreen, element, nifty, screen, attributes, controllers);
    initEffect(EffectEventId.onHover, onHover, element, nifty, screen, attributes, controllers);
    initEffect(EffectEventId.onStartHover, onStartHover, element, nifty, screen, attributes, controllers);
    initEffect(EffectEventId.onEndHover, onEndHover, element, nifty, screen, attributes, controllers);
View Full Code Here

  public XmlBaseType() {
  }

  public XmlBaseType(final XmlBaseType src) {
    if (src.attributes != null) {
      attributes = new Attributes(src.attributes);
    }
  }
View Full Code Here

  public Attributes getAttributes() {
    return attributes;
  }

  public void initFromAttributes(final Attributes attributesParam) {
    attributes = new Attributes(attributesParam);
  }
View Full Code Here

TOP

Related Classes of com.rapleaf.jack.test_project.database_1.models.Post$Attributes

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.