小编Har*_*hna的帖子

如何在 jQuery 中克隆单选按钮并修改选中状态?

我已经克隆了单选列表,同时我选中了单选按钮并单击了“添加更多”按钮,然后添加了新的克隆单选列表,但添加了单选列表,单选按钮未被用户修改/检查,单选按钮的状态是固定的。这是我的 html 代码

<div class="Box">
   <div class="form-group">
        <label ><span>Note Type:</span></label>
         <div class="radio-list">                
                <label><input type="radio" name="optionsRadios" id="optionsRadios1" value="Subjective"> Subjective</label>
                <label><input type="radio" name="optionsRadios" id="optionsRadios2" value="Objective" > Objective</label>
         </div>
         <div class="abc">
            <button type="button" id="num">Add More</button>
         </div>
   </div>  
<div>
Run Code Online (Sandbox Code Playgroud)

她是js代码。

   $("#num").click(function () {
       var p = $('.form-group').length;
       var cloned = $(".form-group:first").clone(true)
                .find('input:radio').attr('name', 'optionsRadios' + ++p).end()
                .appendTo('.Box');
    });
Run Code Online (Sandbox Code Playgroud)

html css jquery

4
推荐指数
1
解决办法
5412
查看次数

如何纠正此映射异常(使用@OneToMany或@ManyToMany定位未映射的类)

嗨,我得到一些映射异常请遵循以下错误

org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.cmr.daos.child.domain.Child.medications[com.cmr.daos.child.domain.Medications]
    at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:1185)
    at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:710)
    at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:645)
    at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:65)
    at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1716)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1423)
    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:720)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
    ... 62 more
Run Code Online (Sandbox Code Playgroud)

我的域名类:

 public class Child extends AuditProperties implements java.io.Serializable {

@Expose private Long childId;
@Expose private String firstName;
@Expose private String lastName;

private Set<Allergies> allergies = new HashSet<Allergies>();

private Set<Medications> medications = new HashSet<Medications>();

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "child")
@JsonManagedReference …
Run Code Online (Sandbox Code Playgroud)

spring hibernate

2
推荐指数
1
解决办法
6354
查看次数

标签 统计

css ×1

hibernate ×1

html ×1

jquery ×1

spring ×1