下面列出的C#类生成此XML:
<Standardize><TestString>Some Data</TestString></Standardize>
Run Code Online (Sandbox Code Playgroud)
但是,我想要的是:
<Standardize>Some Data</Standardize>
Run Code Online (Sandbox Code Playgroud)
换句话说,我希望TestString属性的内容显示在XML中,但我不希望将TestString属性列为元素.我可以添加一些属性来实现吗?
/// <Serialized C# Class/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.225")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://test.com/Services/1")]
public partial class Standardize {
private string testField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.None, IsNullable=true, ElementName=null)]
public string TestString {
get {
return testField;
}
set {
testField;= value;
}
}
}
Run Code Online (Sandbox Code Playgroud) 我试图反序列化来自Javascript UI的JSON对象,但我一直得到400 - "客户端发送的请求语法不正确"错误.注意,我知道REST服务有效,因为如果我对JSON进行硬编码,我可以成功地使用该服务,但现在我正在尝试从实际的JS对象生成JSON.
Spring是否会生成可以帮助解决这个问题的日志消息?如果是这样,那我该怎么设置呢?
ID ATTRID VALSTR
1771373 1 1234
1771373 3 510
1771373 7 2016
1771373 8 05
1777623 3 5003
1777623 7 2016
1777623 8 05
1778103 3 520
1778103 7 2016
1778103 8 06
Run Code Online (Sandbox Code Playgroud)
我只想选择三个条件
AttrId = 3 AND ValStr = 510
AttrId = 7 AND ValStr = 2016
AttrId = 8 AND ValStr = 05
Run Code Online (Sandbox Code Playgroud)
我的查询是这样的,但查询返回所有ID
SELECT *
FROM Table
WHERE ((AttrID = 3 AND ValStr ='510') OR
(AttrID = 7 AND ValStr ='2016') OR
(AttrID = 8 AND ValStr …Run Code Online (Sandbox Code Playgroud) 标题中列出的错误让我发疯.棱角为何如此挑剔?我的语法有什么问题?我正在尝试使用路径定义控制器和子控制器.
// Declare app level module which depends on filters, and services
var mmm = angular.module('mdp',['ngRoute', 'mmm.controllers']);
mmm.config(['$routeProvider','$locationProvider','$compileProvider','$httpProvider', function($routeProvider, $locationProvider,$compileProvider,$httpProvider) {
$routeProvider
.when('/', {
redirectTo: '/commission',
controller: 'mmmController'
})
.when('/commission', {
templateUrl: 'form.html',
controller: 'commCtlr'
})
.otherwise({
redirectTo: '/commission'
});
$compileProvider.debugInfoEnabled(false);
$httpProvider.useApplyAsync(true);
}])
angular.module('mmm.controllers',[]);
var mmmControllers = angular.module('mmm.controllers');
mmmControllers.controller('mmmController', ["$scope","$rootScope","$http","$location","$route","$log"],function ($scope,$rootScope, $http,$location,$route,$log) {
});
mdpControllers.controller('commCtlr',["$scope"], function($scope) {
});
Run Code Online (Sandbox Code Playgroud) 我在Eclipse Oxygen中使用Hibernate Tools收到“未处理的事件循环异常”。当我尝试“完成”以下“休眠配置向导”时,会出现此错误。请注意,我已经尝试了此页面上条目的多种组合,所有这些均导致该异常。
1)我该如何解决?
2)Hibernate Tools是否值得解决此问题?
如果这些工具可行的话,它们似乎很酷。
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:270)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:232)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:241)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:356)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:112)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:84)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:470)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:91)
at org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:183)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.buildFromMetadataSources(MetadataHelper.java:49)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MetadataHelper.getMetadata(MetadataHelper.java:21)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.ConfigurationFacadeImpl.getMetadata(ConfigurationFacadeImpl.java:174)
at org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor.createMetadata(ConfigurationMetadataDescriptor.java:20)
at org.hibernate.tool.hbm2x.AbstractExporter.buildMetadata(AbstractExporter.java:207)
at org.hibernate.tool.hbm2x.AbstractExporter.getMetadata(AbstractExporter.java:57)
at org.hibernate.tool.hbm2x.AbstractExporter.setupContext(AbstractExporter.java:178)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.tools.hibernate.runtime.common.Util.invokeMethod(Util.java:43)
at org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade.start(AbstractExporterFacade.java:72)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard.openContentStream(NewConfigurationWizard.java:301)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard.access$2(NewConfigurationWizard.java:295)
at org.hibernate.eclipse.console.wizards.NewConfigurationWizard$1.getInitialContents(NewConfigurationWizard.java:163)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile(WizardNewFileCreationPage.java:380) …Run Code Online (Sandbox Code Playgroud)