hibernate-mapping

“Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements”

泪湿孤枕 提交于 2020-01-30 15:25:08
问题 Good morning Stackoverflow, I have the problem that it gives me the error: Failed to create sessionFactory object.org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: nl.scalda.pasimo.model.employeemanagement.EducationTeam.coachGroups Do you know why? @OneToMany(cascade=CascadeType.ALL, targetEntity=CoachGroup.class) @JoinColumn(name="id") private TreeSet<CoachGroup> coachGroups = new TreeSet<>(); private

Hibernate HQL Query with outer join

无人久伴 提交于 2020-01-28 11:23:28
问题 I would like to ask how to change the OUTER from Informix to HQL query. Currently facing error with unexpected token:outer SQL query: select a.SC_OB_PROFILE_CODE, b.SC_ORIG_SF_GROUP_CODE, f.SC_ORIG_SAC, f.SC_ORIG_FAC,b.SC_PROD_CONT_GROUP_CODE, d.SC_PROD_CONT_CODE, e.GP_CD, a.SC_ORIG_COUNTRY, a.SC_DEST_COUNTRY, a.SC_DEST_SAC, a.SC_DEST_FAC, a.SC_SEND_DOW, a.SC_OB_SORT_CODE, a.ORIG_OB_SORT_CODE, a.TARGET_OB_SORT_CODE, a.SC_TIMESTAMP from SC_OB_TEMP_AUDIT2 a, SC_OB_ALLOCATION b, outer SC_FAC

How to filter an entity in hibernate with hibernate filters

风格不统一 提交于 2020-01-24 23:03:15
问题 I need to filter an entity in a list of objects, for example: public class Student { private int id; private List<Course> courses; } public class Course { private int id; private String name; private float note; private Classroom classroom; } public class Classroom { private int id; private String classroom; } How to obtain a student object with a list of courses with only notes greater than 70, and located in classroom 23 (for example)? Is there a way to use the name of the entity instead of

Hibernate Mapping One To Many Relationship:Parent's PK to Child's FK

好久不见. 提交于 2020-01-24 13:24:21
问题 I have a classic one to many relationship and while saving it with Hibernate, I am not able to pass parent's PK column value to Child's FK column. Parent Class @Id @GeneratedValue(strategy=GenerationType.AUTO) private int holdingPK; @OneToMany(mappedBy="holding",targetEntity=PolicyType.class,fetch=FetchType.LAZY, cascade = CascadeType.ALL) @XmlElement(name = "Policy") private Set<PolicyType> policy; Child Class @Id @GeneratedValue(strategy=GenerationType.AUTO) private int policyPK; @ManyToOne

No Dialect mapping for JDBC type: -9 with Hibernate 4 and SQL Server 2012 [duplicate]

只愿长相守 提交于 2020-01-23 13:34:25
问题 This question already has answers here : JPA SQL Server No Dialect mapping for JDBC type: -9 (5 answers) Closed last month . I am using the latest Hibernate 4.2.7.SP1 along with the entity-manager, and validator, etc. I am using he Microsoft SQL Server 2012. The code I am trying to use is: StringBuffer sb = new StringBuffer(); sb.append("SELECT vr.account_name as account FROM MY_VIEW_RECEIVABLES vr;"); String sql = sb.toString(); System.out.println("MyInvoiceDAO: getInvoices: SQL=" + sql);

No Dialect mapping for JDBC type: -9 with Hibernate 4 and SQL Server 2012 [duplicate]

大城市里の小女人 提交于 2020-01-23 13:34:22
问题 This question already has answers here : JPA SQL Server No Dialect mapping for JDBC type: -9 (5 answers) Closed last month . I am using the latest Hibernate 4.2.7.SP1 along with the entity-manager, and validator, etc. I am using he Microsoft SQL Server 2012. The code I am trying to use is: StringBuffer sb = new StringBuffer(); sb.append("SELECT vr.account_name as account FROM MY_VIEW_RECEIVABLES vr;"); String sql = sb.toString(); System.out.println("MyInvoiceDAO: getInvoices: SQL=" + sql);

No Dialect mapping for JDBC type: -9 with Hibernate 4 and SQL Server 2012 [duplicate]

扶醉桌前 提交于 2020-01-23 13:33:30
问题 This question already has answers here : JPA SQL Server No Dialect mapping for JDBC type: -9 (5 answers) Closed last month . I am using the latest Hibernate 4.2.7.SP1 along with the entity-manager, and validator, etc. I am using he Microsoft SQL Server 2012. The code I am trying to use is: StringBuffer sb = new StringBuffer(); sb.append("SELECT vr.account_name as account FROM MY_VIEW_RECEIVABLES vr;"); String sql = sb.toString(); System.out.println("MyInvoiceDAO: getInvoices: SQL=" + sql);

Could not locate appropriate constructor on class

点点圈 提交于 2020-01-23 13:14:27
问题 I am trying to map my native SQL result to my POJO, but it's returning an error. Here is the full stack trace: Hibernate: SELECT * FROM members_tb where memberName like ? 2019-12-19 07:40:20.688 TRACE 32472 --- [nio-8084-exec-2] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [%Frank%] java.lang.IllegalArgumentException: Could not locate appropriate constructor on class : com.app.ecclesiamainframe.entity.Members at org.hibernate.loader.custom

org.hibernate.NonUniqueResultException: query did not return a unique result: 462

送分小仙女□ 提交于 2020-01-17 05:31:07
问题 I'm working on an application with Spring using SpringMVC,, i'm encountering the following error and i don't know how to deal with it . now i have this message in Console : org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class java.lang.String at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl

Java Hibernate Mapping Exception! (Could not determine type for: java.util.Map)

不问归期 提交于 2020-01-11 08:49:47
问题 I have made a class with name of Movie with folowing fields: @Id @GeneratedValue private Long id; private String name; @ElementCollection(targetClass = String.class) private Map<String, String> properties; private Double rate; private Integer votersCount; private Date releaseDate; private Integer runtime; @ManyToMany @JoinTable(name = "movie_director") @IndexColumn(name = "directorIndex") private List<Person> directors; @ManyToMany @JoinTable(name = "movie_writer") @IndexColumn(name =