static void ssds() { AbstractTestUtil.init(null, true); Relation branchRelation = new Relation("233", "branch", "", "id", ""); Relation relation = new Relation( "11", "animal", Relation.LIST_MODE, "id", Relation.MORE_TO_ONE, branchRelation); XStream xStream = XStreamFactory.getXStream("tinydb"); System.out.println(xStream.toXML(relation)); }
static { factory = BeanFactory.getFactory(); XStream xStream = XStreamFactory.getXStream(); String beansFile = CUSTOM_ROUTER_BEANS_XML; InputStream inputStream = RouterManagerBeanFactory.class.getResourceAsStream(CUSTOM_ROUTER_BEANS_XML); if (inputStream == null) { inputStream = RouterManagerBeanFactory.class.getResourceAsStream(DEFAULT_ROUTER_BEANS_XML); beansFile = DEFAULT_ROUTER_BEANS_XML; } logger.logMessage(LogLevel.INFO, "加载Bean配置文件{}开始...", beansFile); try { Beans beans = (Beans) xStream.fromXML(inputStream); factory.addBeans(beans); factory.init(); logger.logMessage(LogLevel.INFO, "加载Bean配置文件{}结束。", beansFile); } catch (Exception e) { logger.errorMessage("加载Bean配置文件{}时发生错误", e, beansFile); } }