小编HAY*_*bl4的帖子

将多个libs连接成一个时,不能使用lib函数

我试着学习gulp.我有一个任务,将所有js lib连接到一个lib.min.js

gulp.task("lib-js:build", function () {
    return gulp.src(templates[template].src.libsJs)
        .pipe(concat("libs.min.js"))
        .pipe(uglify())
        .pipe(gulp.dest(templates[template].dist.js));
});
Run Code Online (Sandbox Code Playgroud)

variable templates[template].src.libsJs是一个包含以下值的数组:

var templates = {
    balmy: {
        dist: {
            default: "templates/balmy/dist",
            html: "templates/balmy/dist/",
            js: "templates/balmy/dist/resources/js/",
            css: "templates/balmy/dist/resources/css/",
            fonts: "templates/balmy/dist/resources/fonts/",
            img: "templates/balmy/dist/resources/img/"
        },
        src: {
            html: "templates/balmy/*.html",
            js: "templates/balmy/resources/js/*.js",
            css: "templates/balmy/resources/css/balmy.css",
            fonts: "templates/balmy/resources/fonts/**/*.*",
            fontsCss: "templates/balmy/resources/css/fonts.css",
            img: "templates/balmy/resources/img/**/*.*",
            libsJs: [
                "lib/jquery/v3.1.1/jquery-3.1.1.min.js",
                "lib/jquery-easing/v1.3/jquery.easing.min.js",
                "lib/bootstrap/v4.0.0-alpha.6/bootstrap.min.js",
                "lib/magnific-popup/v1.1.0/magnific-popup.js",
                "lib/owl-carousel/v2.2.1/owl.carousel.min.js",
                "lib/bootstrap-multiselect/bootstrap-multiselect.min.js",
                "lib/bootstrap-multiselect/bootstrap-multiselect-collapsible-groups.min.js",
                "lib/viewportchecker/v1.8.7/viewportchecker.min.js"
            ],
            libsCss: [
                "lib/owl-carousel/v2.2.1/owl.carousel.min.css",
                "lib/owl-carousel/v2.2.1/owl.theme.default.min.css",
                "lib/animation/v3.5.1/animate.min.css",
                "lib/magnific-popup/v1.1.0/magnific-popup.css",
                "lib/bootstrap-multiselect/bootstrap-multiselect.min.css"
            ]
        },
        needBootstrap: true
    }
}
Run Code Online (Sandbox Code Playgroud)

templates描述所有可能的网站模板的变量在哪里.当我执行时:

gulp build --template balmy …
Run Code Online (Sandbox Code Playgroud)

html javascript gulp

10
推荐指数
1
解决办法
241
查看次数

Jpa - Hibernate ManyToMany做了许多插入连接表

ManyToMany之间有关系WorkDay(有注释ManyToMany)和Event

WorkDay实体

@Entity
@Table(name = "WORK_DAY", uniqueConstraints = { @UniqueConstraint(columnNames = { "WORKER_ID", "DAY_ID" }) })
@NamedQueries({
        @NamedQuery(name = WorkDay.GET_WORK_DAYS_BY_MONTH, query = "select wt from WorkDay wt where wt.worker = :worker and to_char(wt.day.day, 'yyyyMM') = :month) order by wt.day"),
        @NamedQuery(name = WorkDay.GET_WORK_DAY, query = "select wt from WorkDay wt where wt.worker = :worker and wt.day = :day") })
public class WorkDay extends SuperClass {

    private static final long serialVersionUID = 1L;

    public static final String …
Run Code Online (Sandbox Code Playgroud)

oracle hibernate jpa-2.1

8
推荐指数
2
解决办法
4121
查看次数

将数组参数绑定到本机查询

我有表product_spec_entry,包含以下列:

  • product_spec_id
  • commodity_spec_id

对于一个product_spec_id可能是几个commodity_spec_id,例如:

|product_spec_id | commodity_spec_id|
|----------------|------------------|
|1683            |1681              |
|1692            |1693              |
|1692            |1681              |
|1692            |1687              |
|1692            |1864              |
|1860            |1681              |
|1868            |1681              |
|1868            |1864              |
Run Code Online (Sandbox Code Playgroud)

我希望得到所有具有所有commodity_spec_id的product_spec_id作为参数传递.

我写了下一个查询:

SELECT ps.product_spec_id, commodities
FROM (
       SELECT
         product_spec_id,
         array_agg(commodity_spec_id) AS commodities
       FROM system.product_spec_entry
       GROUP BY product_spec_id) ps
WHERE Cast(ARRAY [1681, 1864] as BIGINT[]) <@ Cast(ps.commodities as BIGINT[]);
Run Code Online (Sandbox Code Playgroud)

它工作正常,并返回预期的结果:

product_spec_id = 1692,1868

我尝试将此查询用于JPA本机查询:

String query = "SELECT ps.product_spec_id " …
Run Code Online (Sandbox Code Playgroud)

java sql postgresql hibernate jpa

5
推荐指数
2
解决办法
3027
查看次数

标签 统计

hibernate ×2

gulp ×1

html ×1

java ×1

javascript ×1

jpa ×1

jpa-2.1 ×1

oracle ×1

postgresql ×1

sql ×1