ebean

play framework 2 ebean @manytoone Column specified twice

安稳与你 提交于 2019-12-10 23:37:30
问题 I'm running to some problems with ebean (using play framework 2 version 2.2.1) I have two classes: my graph class: public class Graph extends Model { @Id @Column(name="id") private String id; @Column(name="type") private String type; @OneToMany(mappedBy="valGraph", cascade=CascadeType.ALL) private List<Val> valItems; and my value class (with Val.graphId foreign key Graph.id): public class Val extends Model @Id @Column(name="valId") private String valId; @Id @Column(name="graphId") private

Heroku App (play) working fine locally, then not saving to database on server

扶醉桌前 提交于 2019-12-10 20:51:57
问题 On Heroku using Play V2. Everything works fine when tested locally, but then when I deploy to Heroku and attempt to save to a PostgreSQL database I get the following error. In my Procfile I have this. web: target/start -Dhttp.port=${PORT} -DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.postgresql.Driver Here are my Heroku Error Logs: 2012-04-03T18:16:05+00:00 app[web.1]: play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [

Converting Play! framework evolution from MySQL to PostgreSQL

让人想犯罪 __ 提交于 2019-12-10 17:05:28
问题 I am using plaframework 2.2.1, I had made a project MySQL but now i want to shift my project to PostgreSQL but having some errors recreating the DB evolution. My old evolution(1.sql) for mysql which worked fine is: # --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table product ( id bigint auto_increment not null, name varchar(255), price float, constraint pk_product primary key (id)) ; create table shop ( id bigint

Avaje Ebean. ManyToMany deferred BeanSet

╄→гoц情女王★ 提交于 2019-12-10 16:59:48
问题 I am writing small app, using Play Framework 2.0 which uses Ebean as ORM. So I need many-to-many relationship between User class and UserGroup class. Here is some code: @Entity public class User extends Domain { @Id public Long id; public String name; @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) public Set<UserGroup> groups = new HashSet(); } @Entity public class UserGroup extends Domain { @Id public Long id; public String name; @ManyToMany(mappedBy="groups") public Set

If condition always routing towards hasError condition while submitting a form

懵懂的女人 提交于 2019-12-10 15:43:06
问题 I have created a simple form to add a shop, every shop has a manytoone relation with the member Shop.java model package models; @Entity public class Shop extends Model { @Id@SequenceGenerator(name = "shop_gen", sequenceName = "shop_id_seq", allocationSize = 1)@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "shop_gen")@Column(name = "id") public Long id; @Required public String name; @Required public String addressLine1; public String addressLine2; public String addressLine3;

How can I sort related entities in Ebean?

巧了我就是萌 提交于 2019-12-10 03:59:44
问题 I am using Play Framework and Ebean ORM. Say, I have 2 related entity classes (Card.java and FinalMark.java) Card.java @Entity public class Card extends Model { private static final long serialVersionUID = 1L; @Id . . . @OneToMany(mappedBy = "card") public List<FinalMark> finalMarks; . . . public static Finder<Integer, Card> find = new Finder<>(Integer.class, Card.class); } FinalMark.java @Entity public class FinalMark extends Model { private static final long serialVersionUID = 1L; @Id

OptimisticLockException with Ebean and Play Framework 2

妖精的绣舞 提交于 2019-12-09 12:24:46
问题 I am using Ebean with Play Framework 2 and sometimes it falls with OptimisticLockException of such kind: play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[OptimisticLockException: Data has changed. updated [0] rows sql[update manager set modification_time=?, session_id=?, expiration_date=? where id=? and rating=? and creation_time=? and modification_time=? and name=? and surname=? and login=? and password_hash=? and email=? and session_id=? and expiration_date=?] bind

How mature is Ebean or Siena? [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 08:06:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . In the last time I heard a lot of complaining about hibernate. And indeed I have some painful experiences with hibernate too. So I read about Ebean and Siena. Both have interesting approaches. Unfortunately, database access layers are very easy to write, but if your project

Ebean query using setDistinct() does not work

孤街浪徒 提交于 2019-12-08 17:02:37
问题 I'm using an ebean query in the play! framework to find a list of records based on a distinct column. It seems like a pretty simple query but the problem is the ebean method setDistinct(true) isn't actually setting the query to distinct. My query is: List<Song> allSongs = Song.find.select("artistName").setDistinct(true).findList(); In my results I get duplicate artist names. From what I've seen I believe this is the correct syntax but I could be wrong. I'd appreciate any help. Thank you. 回答1:

Play Framework 2 Ebean and InheritanceType as JOINED

。_饼干妹妹 提交于 2019-12-08 16:35:31
问题 After some research on Google, I haven't found anyone who has my problem that's why I'm posting it here. In my application I have three entities : User (abstract), Customer, Agency. Customer and Agency extends User. Here is the code of User : @Entity @Inheritance(strategy = InheritanceType.JOINED) public abstract class User extends AbstractModel { @Column(unique = true) @NotNull @Email public String email; @NotNull public String password; } The problem is that the generated schema creates