我现在有一个包含大约190个元素的列表.如何将列表拆分为每个列表中最多包含50个元素的较小列表?
结果可能是50,50,50和40个元素的列表.
我正在使用ksoap2-android通过SSL调用wcf服务.我可以在没有SSL的情况下使用它,但现在我想通过SSL进行调用,但我遇到了一些问题.
我正在使用HttpsTransportSE而不是HttpTransportSE,但我收到错误:javax.net.ssl.SSLException:不受信任的服务器证书
我怎样才能解决这个问题?
我可以将服务器证书添加到Android中的Keystore来解决问题吗?
private static final String SOAP_ACTION = "http://example.com/Service/GetInformation";
private static final String METHOD_NAME = "GetInformation";
private static final String NAMESPACE = "http://example.com";
private static final String URL = "dev.example.com/Service.svc";
public static Result GetInformation()
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo property = new PropertyInfo();
property.name = "request";
Request request =
new Request("12", "13", "Ben");
userInformationProperty.setValue(request);
userInformationProperty.setType(request.getClass());
request.addProperty(property);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
envelope.addMapping(NAMESPACE, "Request",new Request().getClass());
HttpsTransportSE transport = new HttpsTransportSE(URL, 443, "", …Run Code Online (Sandbox Code Playgroud) 数据结构如下:房子有很多房间.每个房间都有很多人.
我想做的是让所有人都入住.在纯SQL中我会写以下内容:
SELECT * FROM Person WHERE Room_id
IN
(SELECT Id FROM Room WHERE House_id = 1)
Run Code Online (Sandbox Code Playgroud)
我怎么能用Fluent NHibernate'ish代码写出来?
对于此示例,我们可以假设实体和映射看起来像这样:
众议院实体
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual IEnumerable<Room> Rooms { get; set; }
Run Code Online (Sandbox Code Playgroud)
房子映射
Id(x => x.Id);
Map(x => x.Name);
HasMany(x => x.Rooms);
Run Code Online (Sandbox Code Playgroud)
房间实体
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual House House { get; set; } …Run Code Online (Sandbox Code Playgroud)