www.91084.com

GVKun编程网logo

Spring Data JPA - create @Composite key for the three tables

17

在本文中,我们将为您详细介绍SpringDataJPA-create@Compositekeyforthethreetables的相关知识,此外,我们还会提供一些关于100.Inwhichsituat

在本文中,我们将为您详细介绍Spring Data JPA - create @Composite key for the three tables的相关知识,此外,我们还会提供一些关于100.In which situations does the Oracle Data Pump use external tables and not the direct path load w、Android SQLite select * from table where name like%key%using prepared statements、cmake configure 的 gitache-populate 步骤给出了错误:fatal: ambiguous argument 'stable': unknown revision or path not in the working tree、datatables 和 ng-repeat 以及 tableExport问题的有用信息。

本文目录一览:

Spring Data JPA - create @Composite key for the three tables

Spring Data JPA - create @Composite key for the three tables

我开发了以下代码,但不确定如何将记录保存到数据库中。

Stock.java

@Entitypublic class Stock implements Serializable {    private static final long serialVersionUID = 1L;    @Id    @GeneratedValue(strategy = IDENTITY)    @Column(name = "STOCK_ID", unique = true, nullable = false)    private Integer stockId;    @Column(name = "STOCK_CODE", unique = true, nullable = false, length = 10)    private String stockCode;    @Column(name = "STOCK_NAME", unique = true, nullable = false, length = 20)    private String stockName;    // Owner of the relationship    @OneToMany(fetch = FetchType.LAZY, mappedBy = "linkPk.stock", cascade = CascadeType.ALL)    private Set<StockCategoryProductLink> stockCategoryProductLinks = new HashSet<>(0);    public Stock() {    }    public Stock(Integer stockId, String stockCode, String stockName,            Set<StockCategoryProductLink> stockCategoryProductLinks) {        super();        this.stockId = stockId;        this.stockCode = stockCode;        this.stockName = stockName;        this.stockCategoryProductLinks = stockCategoryProductLinks;    }    public Integer getStockId() {        return stockId;    }    public void setStockId(Integer stockId) {        this.stockId = stockId;    }    public String getStockCode() {        return stockCode;    }    public void setStockCode(String stockCode) {        this.stockCode = stockCode;    }    public String getStockName() {        return stockName;    }    public void setStockName(String stockName) {        this.stockName = stockName;    }    public Set<StockCategoryProductLink> getStockCategoryProductLinks() {        return stockCategoryProductLinks;    }    public void setStockCategoryProductLinks(Set<StockCategoryProductLink> stockCategoryProductLinks) {        this.stockCategoryProductLinks = stockCategoryProductLinks;    }}

Product.java

public class Product implements Serializable {    private static final long serialVersionUID = 1L;    @Id    @GeneratedValue(strategy = IDENTITY)    @Column(name = "PRODUCT_ID", unique = true, nullable = false)    private Integer productId;    @Column(name = "PRODUCT_NAME")    private String productName;    @Column(name = "PRODUCT_CODE", unique = true, nullable = false, length = 10)    private String productCode;    @OneToMany(mappedBy = "linkPk.product", cascade = { CascadeType.PERSIST, CascadeType.MERGE })    private List<StockCategoryProductLink> userDepartmentRoleLinks;    public Product(String productName, String productCode) {        this.productName = productName;        this.productCode = productCode;    }    public Integer getProductId() {        return productId;    }    public void setProductId(Integer productId) {        this.productId = productId;    }    public String getProductName() {        return productName;    }    public void setProductName(String productName) {        this.productName = productName;    }    public String getProductCode() {        return productCode;    }    public void setProductCode(String productCode) {        this.productCode = productCode;    }    public List<StockCategoryProductLink> getUserDepartmentRoleLinks() {        return userDepartmentRoleLinks;    }    public void setUserDepartmentRoleLinks(List<StockCategoryProductLink> userDepartmentRoleLinks) {        this.userDepartmentRoleLinks = userDepartmentRoleLinks;    }}

Category.java

Entity@Table(name = "category", catalog = "mkyongdb")public class Category implements java.io.Serializable {    private static final long serialVersionUID = 1L;    @Id    @GeneratedValue(strategy = IDENTITY)    @Column(name = "CATEGORY_ID", unique = true, nullable = false)    private Integer categoryId;    @Column(name = "NAME", nullable = false, length = 10)    private String name;    @Column(name = "[DESC]", nullable = false)    private String desc;    @OneToMany(fetch = FetchType.LAZY, mappedBy = "linkPk.category")    private Set<StockCategoryProductLink> stockCategories = new HashSet<>(0);    public Category() {    }    public Category(String name, String desc) {        this.name = name;        this.desc = desc;    }    public Category(String name, String desc, Set<StockCategoryProductLink> stockCategories) {        this.name = name;        this.desc = desc;        this.stockCategories = stockCategories;    }    public Integer getCategoryId() {        return categoryId;    }    public void setCategoryId(Integer categoryId) {        this.categoryId = categoryId;    }    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public String getDesc() {        return desc;    }    public void setDesc(String desc) {        this.desc = desc;    }    public Set<StockCategoryProductLink> getStockCategories() {        return stockCategories;    }    public void setStockCategories(Set<StockCategoryProductLink> stockCategories) {        this.stockCategories = stockCategories;    }}

StockCategoryProductLink.java

@Embeddablepublic class StockCategoryProductLink implements Serializable {    private static final long serialVersionUID = 1L;    @EmbeddedId    private StockCategoryProductLinkId linkPk = new StockCategoryProductLinkId();    @Transient    public Stock getStock() {        return getLinkPk().getStock();    }    @Transient    public Category getCategory() {        return getLinkPk().getCategory();    }    @Transient    public Product getProduct() {        return getLinkPk().getProduct();    }    public StockCategoryProductLinkId getLinkPk() {        return linkPk;    }    public void setLinkPk(StockCategoryProductLinkId linkPk) {        this.linkPk = linkPk;    }}

StockCategoryProductLinkId.java

@Embeddablepublic class StockCategoryProductLinkId {    @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })    @JoinColumn(name = "CATEGORY_ID")    private Category category;    @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })    @JoinColumn(name = "STOCK_ID")    private Stock stock;    @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })    @JoinColumn(name = "PRODUCT_ID")    private Product product;    public Category getCategory() {        return category;    }    public void setCategory(Category category) {        this.category = category;    }    public Stock getStock() {        return stock;    }    public void setStock(Stock stock) {        this.stock = stock;    }    public Product getProduct() {        return product;    }    public void setProduct(Product product) {        this.product = product;    }}

ManyToManyApplication.java

@SpringBootApplicationpublic class ManyToManyApplication implements CommandLineRunner{    public static void main(String[] args) {        SpringApplication.run(ManyToManyApplication.class, args);    }    @Autowired    private CategoryRepository categoryRepository;    @Autowired    private StockRepository stockRepository;    @Autowired    private ProductRepository productRepository;    @Override    public void run(String... args) throws Exception {        saveDataFirstTime();    }    private void saveDataFirstTime() {        // Category        Category category1 = new Category("CONSUMER", "CONSUMER COMPANY");        categoryRepository.save(category1);        // Product        Product product = new Product("Product-1", "AB");        productRepository.save(product);        // Stock        Stock stock = new Stock();        stock.setStockCode("7052");        stock.setStockName("PADINI");        // StockCategoryProductLink        StockCategoryProductLink link = new StockCategoryProductLink();        link.getLinkPk().setCategory(category1);        link.getLinkPk().setProduct(product);        link.getLinkPk().setStock(stock);        stock.getStockCategoryProductLinks().add(link);        stockRepository.save(stock);    }}

Error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ''entityManagerFactory'' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.example.entity.Stock.stockCategoryProductLinks[com.example.entity.StockCategoryProductLink]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]    at com.example.ManyToManyApplication.main(ManyToManyApplication.java:20) [classes/:na]Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.example.entity.Stock.stockCategoryProductLinks[com.example.entity.StockCategoryProductLink]    at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:1274) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:811) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:736) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:54) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1696) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1664) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:287) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) ~[spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]    ... 15 common frames omitted

答案1

小编典典

好吧,我知道您的意思,但我认为这不是您的意思。你说

实际上,我有三个表,库存,类别和产品。@ManyToMany库存与类别之间的关系,以及@ManyToMany
类别与产品之间的关系。

这有助于抽象地考虑这一点。用陈记法说的是

但是,这可能不是您的意思。这是有问题的,因为您
将需要Category为每个StockandProduct
关系建立一个新的实体。因此,如果您有一个ETF类别,那么
BobsBestETFs产品中的每个股票(实际上是每个实例化关系)都将复制它。

您的意思可能更像是通过aStock和Product与Category属性的关系。

这允许许多产品都有很多库存,并且每种产品/库存关系都有特定的类别属性。您将遇到的问题
是,您不想Category成为一个属性,而是想要一个类别的查找表,如下所示:

我想这就是您要寻找的。
使用复合ID实施起来应该相当简单,但是您显示的示例似乎
有些过时或不清楚。最好找到更好的例子。这就是我
对最后一个架构进行建模的方式。

@Entitypublic class Stock {    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)    private Long id;}@Entity@Datapublic class Product {    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)    private Long id;}@Entitypublic class Category {    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)    private Long id;}@Entity@Datapublic class StockProduct {    @EmbeddedId    private StockProductPk id;    @ManyToOne    @MapsId("productId")    private Product product;    @ManyToOne    @MapsId("stockId")    private Stock stock;    @ManyToOne    private Category category;}@Embeddable@Datapublic class StockProductPk implements Serializable {    private static final long serialVersionUID = 1L;    private Long stockId;    private Long productId;}

And as an example to use it:

private void create() {    Category catEtf = new Category();    categoryRepo.save(catEtf);    Stock s1 = new Stock();    stockRepo.save(s1);    Product bobEtfs = new Product();    productRepo.save(bobEtfs);    // create a relationship    StockProduct bs1 = new StockProduct();    bs1.setId(new StockProductPk());    bs1.setProduct(bobEtfs);    bs1.setStock(s1);    bs1.setCategory(catEtf);    stockProductRepo.save(bs1); }private void read() {    StockProduct sp1 = new StockProduct();    Product p1 = new Product();    p1.setId(1L);    sp1.setProduct(p1);    List<StockProduct> bobEtfs = stockProductRepo.findAll(Example.of(sp1, ExampleMatcher.matching()));    System.out.println(bobEtfs);}

100.In which situations does the Oracle Data Pump use external tables and not the direct path load w

100.In which situations does the Oracle Data Pump use external tables and not the direct path load w

100.In which situations does the Oracle Data Pump use external tables and not the direct path load while exporting a table? (Choose all that apply.) A.if a table is not in a cluster B.if a table has an active trigger C.if a table has an encrypted column D.if a table has a column of data type LONG defined on it E.if a table has a referential integrity constraint defined on it 答案:BCE 参考:https://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_overview.htm#i1010293 The default method that Data Pump uses for loading and unloading data is direct path,when the structure of a table allows it. Note that if the table has any columns of datatype LONG,then direct path must be used.(排除D) Situations in Which Direct Path Load Is Not Used A table is in a cluster(排除A) There is an active trigger on a pre-existing table. (B正确) The table has encrypted columns(C正确) A referential integrity constraint is present on a pre-existing table.(E正确) --这里只是列出一部分,具体查看文档

Android SQLite select * from table where name like%key%using prepared statements

Android SQLite select * from table where name like%key%using prepared statements

参见英文答案 > cant use like clause in android app6
我想使用预备的语句来防止在sql sql数据库上的sql注入.但是,当查询包含Like并且与Where name =?一起工作时,rawquery会崩溃?
有没有办法在Android sqlite数据库中使用类似和准备好的语句?

这是查询:

sqlQuery = "SELECT * FROM " + TABLE_CALLS + " where " + CALLER_NAME + " like ? COLLATE NOCASE or " + CALLER_NBR + " like ? or " + CALLER_EXT + " like ?" + " or " + IS_OUTGOING + " like ?  COLLATE NOCASE or " + TYPE + " like ? COLLATE NOCASE";

Cursor cursor = database.rawQuery(sqlQuery,new String[]{"%" + criterion + "%","%" + criterion + "%","%" + criterion + "%"});

它会使绑定或列索引超出范围
谢谢.

解决方法

if (name.length() != 0) {

        name = "%" + name + "%";
    }
    if (email.length() != 0) {
        email = "%" + email + "%";
    }
    if (Phone.length() != 0) {
        Phone = "%" + Phone + "%";
    }
    String selectQuery = " select * from tbl_Customer where Customer_Name like  '"
            + name
            + "' or Customer_Email like '"
            + email
            + "' or Customer_Phone like '"
            + Phone
            + "' ORDER BY Customer_Id DESC";

    Cursor cursor = mDb.rawQuery(selectQuery,null);`

cmake configure 的 gitache-populate 步骤给出了错误:fatal: ambiguous argument 'stable': unknown revision or path not in the working tree

cmake configure 的 gitache-populate 步骤给出了错误:fatal: ambiguous argument 'stable': unknown revision or path not in the working tree

如何解决cmake configure 的 gitache-populate 步骤给出了错误:fatal: ambiguous argument ''stable'': unknown revision or path not in the working tree?

在配置使用 aicxx 和 gitache 的项目时,出现以下错误:

...
[ 11%] Performing update step for ''gitache-populate''
cd /home/carlo/projects/aicxx/linuxviewer/linuxviewer-objdir/_deps/gitache-src && /usr/bin/cmake -P /home/carlo/projects/aicxx/linuxviewer/linuxviewer-objdir/_deps/gitache-subbuild/gitache-populate-prefix/tmp/gitache-populate-gitupdate.cmake
fatal: ambiguous argument ''stable'': unkNown revision or path not in the working tree.
Use ''--'' to separate paths from revisions,like this:
''git <command> [<revision>...] -- [<file>...]''
From https://github.com/CarloWood/gitache
   bef7d0d..5c68f7b  stable     -> origin/stable
CMake Error at /home/carlo/projects/aicxx/linuxviewer/linuxviewer-objdir/_deps/gitache-subbuild/gitache-populate-prefix/tmp/gitache-populate-gitupdate.cmake:121 (message):
....

我该如何解决这个问题?

解决方法

此错误的原因可能是您刚刚拉取了 CMakeLists.txt 更改 从使用一个 gitache 分支切换到另一个分支(从 masterstable in this case)。

最简单的恢复方法是彻底清理项目并从头开始配置。

例如,删除 cmake 构建目录:

rm -rf /home/carlo/projects/aicxx/linuxviewer/linuxviewer-objdir

然后重新运行 ./autogen.sh 并像往常一样配置和构建。 从技术上讲,只有在运行 autogen.sh 后才需要运行 make maintainer-clean,如果项目支持(通常 cmake 不支持,因此必须由项目手动添加),但它永远不会受到伤害。>

datatables 和 ng-repeat 以及 tableExport问题

datatables 和 ng-repeat 以及 tableExport问题

问题描述

  1. datatables 框架和 Angularjsng-repeat 指令一起使用的时候会出现数据无法在表格中展现的错误,点击下表格的 head ,数据就会消失。在 datatables 的官网也有人问过这个问题 is-there-a-way-to-use-ng-repeat-and-datatables。

    错误如图:

  2. ng-repeat 需要的数据需要从 ajax 请求异步获取,导致表格比数据先渲染出来,然后无法把表格中的数据导出到 excel

  3. $scope.$on 调用多次的问题

解决办法:

  1. 使用 angular-datatables 框架解决

  2. 使用 angulardirective$timeout 方式解决。

  3. $scope.$on 调用多次需要使用 destroy 的方式解决

总体代码如下:

表格部分的代码

<table id="main"datatable="ng">
                    <thead>
                    <tr>
                        <th>a</th>
                        <th>b</th>
                        <th>c</th>
                        <th>d</th>
                        <th>e</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in items track by $index" ng-model="items" on-finish-render="ngRepeatFinished">
                        <td>{{item.a}}</td>
                        <td>{{item.b}}</td>
                        <td>{{item.c}}</td>
                        <td>{{item.d}}</td>
                        <td>{{item.e}}</td>
                    </tr>
                    </tbody>
                </table>

JS 代码:

<script type="text/javascript">
    var myapp = angular.module("main",['datatables']);


    myapp.directive('onFinishRender',function ($timeout) {
        return {
            restrict: 'A',link: function (scope,element,attr) {
                if (scope.$last) {
                    $timeout(function () {
                        scope.$emit(attr.onFinishRender);
                    });
                }
            }
        }
    });


    myapp.controller("mainCtrl",['$scope','$http',function ($scope,$http) {
        $scope.trv = {orders: ""};
        $scope.errMsg = "";
        $scope.isdisabled = false;
        $scope.items = {};

        //调用之后销毁,避免调用两次
        var destroyFoo = $scope.$on('ngRepeatFinished',function() {
            $("table").tableExport();
        });


        $scope.$on('ngRepeatFinished',function() {
            destroyFoo();
            console.log("test");
        });

        $scope.test= function () {
            if ($scope.trv.orders== '')
            {
                alert("数据不能为空!");
                return;
            }
            $scope.isdisabled = true;


            var bArray = $('#orders').val().replace(/\s+/g,",");
            var cArray = bArray.split(",");
            var dUnique = $.unique(cArray);
            console.log(dUnique);

            var estr = $.map(dUnique,function (val,index) {
                var str = val;
                return str;
            }).join(",");
            console.log(estr);
            var data = {items: estr};
            var url = "/a/b.json";
            console.log(data);
            $http({
                method: "POST",dataType: "json",contentType: 'application/json',url: url,data: data,}).success(function (data) {
                if (data.success) {
                    $scope.errMsg = "";
                    $scope.items = $.parseJSON('[' + formatData(data.data) + ']');
                    alert("查询完成");
                } else {
                    $scope.errMsg = data.message;
                    console.log("有问题的数据:" + data.data);
                    $scope.items = data.data;
                    $scope.isdisabled = false;
                }
            }).error(function (data) {
                alert(data);
                $scope.isdisabled = false;
            });
        };

        function formatData(data) {
            var lastData = [];
            var pObj = {'a': "",'b': "",'c': "",'d': "",'e': ""};
            Object.keys(data).forEach(function (k) {
                data[k].forEach(function (element) {
                    var vm = JSON.stringify(element);
                    pObj.a = k;
                    pObj.b = element.b;
                    pObj.c = element.c;
                    pObj.d = element.d;
                    pObj.e = element.e;
                    lastData.push(JSON.stringify(pObj));
                });
            });
            return lastData;

        }




    }]);
</script>

今天关于Spring Data JPA - create @Composite key for the three tables的讲解已经结束,谢谢您的阅读,如果想了解更多关于100.In which situations does the Oracle Data Pump use external tables and not the direct path load w、Android SQLite select * from table where name like%key%using prepared statements、cmake configure 的 gitache-populate 步骤给出了错误:fatal: ambiguous argument 'stable': unknown revision or path not in the working tree、datatables 和 ng-repeat 以及 tableExport问题的相关知识,请在本站搜索。

本文标签: