com.j256.ormlite.dao.Dao.objectToString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中com.j256.ormlite.dao.Dao.objectToString()方法的一些代码示例,展示了Dao.objectToString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dao.objectToString()方法的具体详情如下:
包路径:com.j256.ormlite.dao.Dao
类名称:Dao
方法名:objectToString

Dao.objectToString介绍

[英]Return the string version of the object with each of the known field values shown. Useful for testing and debugging.
[中]返回对象的字符串版本,并显示每个已知字段值。用于测试和调试。

代码示例

代码示例来源:origin: j256/ormlite-core

/**
 * @see Dao#objectToString(Object)
 */
@Override
public String objectToString(T data) {
  return dao.objectToString(data);
}

代码示例来源:origin: com.j256.ormlite/ormlite-core

/**
 * @see Dao#objectToString(Object)
 */
@Override
public String objectToString(T data) {
  return dao.objectToString(data);
}

代码示例来源:origin: j256/ormlite-core

/**
 * A call through to the {@link Dao#objectToString(Object)}.
 */
public String objectToString() {
  try {
    checkForDao();
  } catch (SQLException e) {
    throw new IllegalArgumentException(e);
  }
  @SuppressWarnings("unchecked")
  T t = (T) this;
  return dao.objectToString(t);
}

代码示例来源:origin: com.j256.ormlite/ormlite-core

/**
 * A call through to the {@link Dao#objectToString(Object)}.
 */
public String objectToString() {
  try {
    checkForDao();
  } catch (SQLException e) {
    throw new IllegalArgumentException(e);
  }
  @SuppressWarnings("unchecked")
  T t = (T) this;
  return dao.objectToString(t);
}

代码示例来源:origin: com.j256.ormlite/ormlite-jdbc

@Test
public void testObjectToString() throws Exception {
  Dao<Foo, Integer> fooDao = createDao(Foo.class, true);
  String stuff = "foo123231";
  Foo foo1 = new Foo();
  foo1.stuff = stuff;
  String objStr = fooDao.objectToString(foo1);
  assertTrue(objStr.contains(Integer.toString(foo1.id)));
  assertTrue(objStr.contains(stuff));
}

相关文章