mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Change license to Apache2 and reformat
This commit is contained in:
@@ -1,73 +1,54 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class CKeyDetail {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
@ManyToOne
|
||||
// @JoinColumns({
|
||||
// @JoinColumn(name="parent_one_key", referencedColumnName="one_key"),
|
||||
// @JoinColumn(name="parent_two_key", referencedColumnName="two_key")
|
||||
// })
|
||||
CKeyParent parent;
|
||||
|
||||
public CKeyDetail(){
|
||||
|
||||
}
|
||||
public CKeyDetail(String something){
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSomething() {
|
||||
return something;
|
||||
}
|
||||
|
||||
public void setSomething(String something) {
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
public CKeyParent getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(CKeyParent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class CKeyDetail {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
@ManyToOne
|
||||
// @JoinColumns({
|
||||
// @JoinColumn(name="parent_one_key", referencedColumnName="one_key"),
|
||||
// @JoinColumn(name="parent_two_key", referencedColumnName="two_key")
|
||||
// })
|
||||
CKeyParent parent;
|
||||
|
||||
public CKeyDetail(){
|
||||
|
||||
}
|
||||
public CKeyDetail(String something){
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSomething() {
|
||||
return something;
|
||||
}
|
||||
|
||||
public void setSomething(String something) {
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
public CKeyParent getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(CKeyParent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,96 +1,77 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
CKeyParentId id;
|
||||
|
||||
String name;
|
||||
|
||||
@Version
|
||||
int version;
|
||||
|
||||
@ManyToOne(cascade=CascadeType.PERSIST)
|
||||
CKeyAssoc assoc;
|
||||
|
||||
@OneToMany(cascade=CascadeType.PERSIST, mappedBy="parent")
|
||||
List<CKeyDetail> details;
|
||||
|
||||
public CKeyParentId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(CKeyParentId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public CKeyAssoc getAssoc() {
|
||||
return assoc;
|
||||
}
|
||||
|
||||
public void setAssoc(CKeyAssoc assoc) {
|
||||
this.assoc = assoc;
|
||||
}
|
||||
|
||||
public List<CKeyDetail> getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setDetails(List<CKeyDetail> details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public void add(CKeyDetail detail) {
|
||||
if (details == null){
|
||||
details = new ArrayList<CKeyDetail>();
|
||||
}
|
||||
details.add(detail);
|
||||
}
|
||||
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
CKeyParentId id;
|
||||
|
||||
String name;
|
||||
|
||||
@Version
|
||||
int version;
|
||||
|
||||
@ManyToOne(cascade=CascadeType.PERSIST)
|
||||
CKeyAssoc assoc;
|
||||
|
||||
@OneToMany(cascade=CascadeType.PERSIST, mappedBy="parent")
|
||||
List<CKeyDetail> details;
|
||||
|
||||
public CKeyParentId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(CKeyParentId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public CKeyAssoc getAssoc() {
|
||||
return assoc;
|
||||
}
|
||||
|
||||
public void setAssoc(CKeyAssoc assoc) {
|
||||
this.assoc = assoc;
|
||||
}
|
||||
|
||||
public List<CKeyDetail> getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setDetails(List<CKeyDetail> details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public void add(CKeyDetail detail) {
|
||||
if (details == null){
|
||||
details = new ArrayList<CKeyDetail>();
|
||||
}
|
||||
details.add(detail);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,71 +1,52 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
Integer oneKey;
|
||||
String twoKey;
|
||||
|
||||
public CKeyParentId() {
|
||||
|
||||
}
|
||||
public CKeyParentId(Integer oneKey, String twoKey){
|
||||
this.oneKey = oneKey;
|
||||
this.twoKey = twoKey;
|
||||
}
|
||||
|
||||
public Integer getOneKey() {
|
||||
return oneKey;
|
||||
}
|
||||
public void setOneKey(Integer oneKey) {
|
||||
this.oneKey = oneKey;
|
||||
}
|
||||
public String getTwoKey() {
|
||||
return twoKey;
|
||||
}
|
||||
public void setTwoKey(String twoKey) {
|
||||
this.twoKey = twoKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o){
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof CKeyParentId)){
|
||||
return false;
|
||||
}
|
||||
|
||||
CKeyParentId otherKey = (CKeyParentId) o;
|
||||
return otherKey.hashCode() == hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(){
|
||||
int hc = getClass().getName().hashCode();
|
||||
hc = 31 * hc + oneKey;
|
||||
hc = 31 * hc + twoKey.hashCode();
|
||||
return hc;
|
||||
}
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class CKeyParentId {
|
||||
|
||||
Integer oneKey;
|
||||
String twoKey;
|
||||
|
||||
public CKeyParentId() {
|
||||
|
||||
}
|
||||
public CKeyParentId(Integer oneKey, String twoKey){
|
||||
this.oneKey = oneKey;
|
||||
this.twoKey = twoKey;
|
||||
}
|
||||
|
||||
public Integer getOneKey() {
|
||||
return oneKey;
|
||||
}
|
||||
public void setOneKey(Integer oneKey) {
|
||||
this.oneKey = oneKey;
|
||||
}
|
||||
public String getTwoKey() {
|
||||
return twoKey;
|
||||
}
|
||||
public void setTwoKey(String twoKey) {
|
||||
this.twoKey = twoKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o){
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof CKeyParentId)){
|
||||
return false;
|
||||
}
|
||||
|
||||
CKeyParentId otherKey = (CKeyParentId) o;
|
||||
return otherKey.hashCode() == hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(){
|
||||
int hc = getClass().getName().hashCode();
|
||||
hc = 31 * hc + oneKey;
|
||||
hc = 31 * hc + twoKey.hashCode();
|
||||
return hc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +1,44 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class ContactNote extends BasicDomain {
|
||||
|
||||
private static final long serialVersionUID = 7949702621226333278L;
|
||||
|
||||
@ManyToOne
|
||||
Contact contact;
|
||||
|
||||
String title;
|
||||
|
||||
@Lob
|
||||
String note;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class ContactNote extends BasicDomain {
|
||||
|
||||
private static final long serialVersionUID = 7949702621226333278L;
|
||||
|
||||
@ManyToOne
|
||||
Contact contact;
|
||||
|
||||
String title;
|
||||
|
||||
@Lob
|
||||
String note;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,51 +1,32 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
import org.joda.time.LocalTime;
|
||||
|
||||
@Entity
|
||||
public class TJodaEntity {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
LocalTime localTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalTime getLocalTime() {
|
||||
return localTime;
|
||||
}
|
||||
|
||||
public void setLocalTime(LocalTime localTime) {
|
||||
this.localTime = localTime;
|
||||
}
|
||||
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
import org.joda.time.LocalTime;
|
||||
|
||||
@Entity
|
||||
public class TJodaEntity {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
LocalTime localTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalTime getLocalTime() {
|
||||
return localTime;
|
||||
}
|
||||
|
||||
public void setLocalTime(LocalTime localTime) {
|
||||
this.localTime = localTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,49 +1,30 @@
|
||||
/**
|
||||
* Copyright (C) 2009 Authors
|
||||
*
|
||||
* This file is part of Ebean.
|
||||
*
|
||||
* Ebean is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Ebean is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Ebean; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class TruckRef {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSomething() {
|
||||
return something;
|
||||
}
|
||||
|
||||
public void setSomething(String something) {
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
}
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class TruckRef {
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
String something;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSomething() {
|
||||
return something;
|
||||
}
|
||||
|
||||
public void setSomething(String something) {
|
||||
this.something = something;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user