parentid

JPA map relation entity parentID

断了今生、忘了曾经 提交于 2019-12-11 19:43:13
问题 could someone help me to understand how can I define an entity with JPA mapping that has a relation with it self? For example, my entity is CompanyDivision, divisionA contains divisionB, divisionC and divisionB contains divisionB1, divisionB2 divisionA divisionB divisionB1 divisionB2 divisionC Thank you! 回答1: It's not different from a relation between 2 different Entities. Here's an example: class CompanyDivision { @OneToMany(mappedBy = "parentDivision") private Set<CompanyDivision>

Angularjs: ng-options group by

。_饼干妹妹 提交于 2019-11-27 05:14:28
I have this one level tree situation: <select ng-model="tipost" ng-options="tip.DESC group by tip.TIPIS for tip in tipall"><br> </select> where the json is: [ {"ID":"1", "IDPARENT":"0", "TIPIS":"", "DESC":"GroupName1"}, {"ID":"2", "IDPARENT":"1", "TIPIS":"GroupName1", "DESC":"CHILDNAME1"}, {"ID":"3", "IDPARENT":"0", "TIPIS":"", "DESC":"GroupName2"} ] the problem is that this creates the optgroups with their children but repeats the roots too: - GroupName1 - GroupName2 [ GroupName1 ] - CHILDNAME1 [ GroupName2 ] i want to produce: [ GroupName1 ] - CHILDNAME1 [ GroupName2 ] The grouping doesn't

Angularjs: ng-options group by

眉间皱痕 提交于 2019-11-26 11:29:01
问题 I have this one level tree situation: <select ng-model=\"tipost\" ng-options=\"tip.DESC group by tip.TIPIS for tip in tipall\"><br> </select> where the json is: [ {\"ID\":\"1\", \"IDPARENT\":\"0\", \"TIPIS\":\"\", \"DESC\":\"GroupName1\"}, {\"ID\":\"2\", \"IDPARENT\":\"1\", \"TIPIS\":\"GroupName1\", \"DESC\":\"CHILDNAME1\"}, {\"ID\":\"3\", \"IDPARENT\":\"0\", \"TIPIS\":\"\", \"DESC\":\"GroupName2\"} ] the problem is that this creates the optgroups with their children but repeats the roots too