我尝试使用条件获取列表Restrictions.ne("status","ERROR")但是方法返回没有实体的列表status is null.
public List<Match_soccer> getDayMatches(Date day){
//Match_soccer where date between start and end dates and status != null
Criteria criteria = session.createCriteria(Match_soccer.class);
criteria.add(Restrictions.between("start", day, DateJobs.addnHours(DateJobs.nextDay(day), 3)));
criteria.add(Restrictions.ne("status","ERROR"));
return criteria.list();
}
Run Code Online (Sandbox Code Playgroud) 我有一个类,AthleticCompetitionResults并希望创建一个类,方法返回AthleticCompetitionResults从行初始化的对象,例如
Siim Susi; 12.61; 5.00; 9.22; 1.50; 60.39; 16.43; 21.60; 2.60; 35.81; 5.25.72
Siim Susi2; 12.61; 5.00; 9.22; 1.50; 60.39; 16.43; 21.60; 2.60; 35.81; 5.25.72
Jaana Lind; 13.75; 4.84; 10.12; 1.50; 68.44; 19.18; 30.85; 2.80; 33.88; 6.22.75
public class AthleticCompetitionResults {
private Athletic athletic;
private float resultM100;
private float resultLongJump;
private float resultShotPut;
private float resultHighJump;
private float resultM400;
private float resultHurdles110m;
private float resultDiscusThrow;
private float resultPoleVault;
private float resultJavelinThrow;
private float resultM1500;
private int …Run Code Online (Sandbox Code Playgroud) 我使用Angular 1.5和ui.router模块,并希望将int数组传递到app throw url.www.example.com/#/filter?[1,2,5]或www.example.com/#/filter/[1,2,5]或其他内容.
.state('cats', {
url: '/filter?catsIds', // or /filter/{catsIds}
templateUrl:'cats.html',
controller: 'catsCtrl'
})
Run Code Online (Sandbox Code Playgroud)
目标:
app.controller('catsCtrl',function($stateParams){
console.log(Array.isArray($stateParams.catsIds)) // goal true
...
Run Code Online (Sandbox Code Playgroud) 我有git存储库/var/www/html/projectx.我的目标是告诉git忽略两个文件 /var/www/html/projectx/error.log和/var/www/html/projectx/requsets.log.
我尝试添加.gitignore文件
[git@x]$ cd /var/www/html/projectx
[git@x projectx]$ nano .gitignore
Run Code Online (Sandbox Code Playgroud)
.gitignore:
*~
*.log
Run Code Online (Sandbox Code Playgroud) 我尝试导入cheerio到typescript基于我的应用程序。
import {cheerio} from 'cheerio';
console.log(cheerio); //undefined
Run Code Online (Sandbox Code Playgroud)
从package.json:
...
"@types/cheerio": "^0.22.5
...
Run Code Online (Sandbox Code Playgroud) 我正在迁移webpack 4到webpack 5.
config/webpack.js 已:
`开发工具:是生产?“隐藏源映射”:“廉价模块评估源映射”
迁移后出错:
onfiguration.devtool 应该匹配模式“^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$”。
看起来新的webpack不喜欢条件,因为如果我更改为:
devtool: 'hidden-source-map'
错误消失了。
我想winston在应用程序中使用记录器node将错误记录到文件中。但winston不写入文件。
var logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)(),
new (winston.transports.File)({ filename: 'somefile.log' })
]
});
logger.error('test');
Run Code Online (Sandbox Code Playgroud)
文件somefile.log已创建但为空。
我想传递给服务器数组的对象抛出graphqlAPI。
我对架构的查询:
export const schema = buildSchema(`
type Query {
statistics(
modelId: String
picksEnds: [PickEnd]
)
}: Statistics
type PickEnd {
end: String
limit: float
}
...
`)
Run Code Online (Sandbox Code Playgroud)
我在客户端基于 js 的查询:
const createStatisticsQuery = (...) => {
return `query {
statistics(
modelId: "${modelId}",
picksEnds: ${JSON.stringify(myEnds)}
) ...
Run Code Online (Sandbox Code Playgroud)
但出现错误graphql:
消息:“语法错误:预期名称,找到字符串“end””
请求负载中的片段:
{"query":"查询 {\n 统计信息(\n modelId: \"5ca0f4afb88b3a2e006faa0d\",\n picksEnds: [{\"end\":\"home\"},{\"end\":\"绘制\"},{\"end\":\"away\"},{\"end\":\"under\",\"limit\":0.5},{\"end\":\"超过\",\"限制\":0.5},{\"结束\":\"低于\",\"限制\":1.5 ...
我刚刚开始使用 junit/单元测试工具。现在我感受到了它的好处 :) 如果 junit 测试失败,是否可以打印字段值?
\n\n我的方法尝试实现 INT(A(D \xe2\x80\x94 B)^C):
public static int countFieldEventPoints(PointsCountingTableRow row,float centimetres){\n float temp = row.getA()*(float)Math.pow((centimetres - row.getB()),row.getC());\n return roundUP(temp);\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我的测试:
\n\npublic void testCountlongJumpEventPoints(){\n PointsCountingTableRow row = Tables.get2001table().getLongJump();\n float cm = 736f;\n assertEquals(900,PointCounterService.countFieldEventPoints(row,cm));\n}\nRun Code Online (Sandbox Code Playgroud)\n\n控制台打印:
\n\njava.lang.AssertionError: \nExpected :900\nActual :901\nRun Code Online (Sandbox Code Playgroud)\n\n向上取整的方法(我感觉有问题):
\n\nprivate static int roundUP(double floatNumber){\n return (int) Math.round(floatNumber + .5);\n}\nRun Code Online (Sandbox Code Playgroud)\n\n行类:
\n\npublic class PointsCountingTableRow {\nprivate float A;\nprivate float B;\nprivate float C;\n\n\npublic PointsCountingTableRow(float a, float b, float c) …Run Code Online (Sandbox Code Playgroud) 我尝试在我的旧 AngularJS 项目上开始使用 TypeScript 2.4.1。首先,我尝试将我的简单控制器重构为 ts。在控制器上,我在编译过程中使用匿名函数获取Error:(35, 11) TS2339:Property 'app' does not exist on type 'Window'.
(function (app) {
'use strict';
app.ReservationModule.controller('ItineraryController', ItineraryController);
ItineraryController.$inject = [
'SeatMapService',
'SeatMapSegments'
];
/**
* Controlling interaction between seatMap service and Itinerary view.
*/
function ItineraryController(SeatMapService:any, SeatMapSegments:any) {
const vm = this;
vm.deselectService = deselectService;
vm.show = show;
/**
* Deselect traveller seat on seatMap service by segment.
*/
function deselectService(traveller, segment) {
SeatMapService.deselectService(traveller, segment);
}
/**
* Returns true if segment has new …Run Code Online (Sandbox Code Playgroud) 我有两个Java Hibernate有oneToMany关系的实体.我也有Spring控制器和AngularJS前端.当我尝试/cars/getCars在Chrome浏览器中,我得到网络状态失败.Eclipse停止工作(冻结).
@Entity
@Table(name="auto")
public class Make {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@Column(length = 100)
private String make;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "make")
private List<Model> models = new ArrayList<Model>(0);
public String getMake() {
return make;
}
...
}
Run Code Online (Sandbox Code Playgroud)
和
@Entity
@Table(name="models")
public class Model {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@Column(length = 100)
private String model;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "fk_maker")
private Make make;
public …Run Code Online (Sandbox Code Playgroud) java ×4
angularjs ×2
hibernate ×2
javascript ×2
typescript ×2
cheerio ×1
git ×1
graphql ×1
junit ×1
node.js ×1
unit-testing ×1
webpack ×1
winston ×1