Revision 45711
Added by Panagiotis Kanakakis about 7 years ago
modules/uoa-goldoa-service/branches/hibernate/src/test/resources/dataSource.xml | ||
---|---|---|
18 | 18 |
<property name="username" value="${goldoa.db.username}" /> |
19 | 19 |
<property name="password" value="${goldoa.db.password}" /> |
20 | 20 |
</bean> |
21 |
|
|
21 |
|
|
22 | 22 |
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> |
23 | 23 |
<property name="dataSource" ref="goldoa.dataSource" /> |
24 | 24 |
<property name="configLocation" value="classpath:hibernate-cfg.xml" /> |
modules/uoa-goldoa-service/branches/hibernate/src/test/resources/hibernate-cfg.xml | ||
---|---|---|
7 | 7 |
|
8 | 8 |
<hibernate-configuration> |
9 | 9 |
<session-factory> |
10 |
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
|
|
10 |
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</property>
|
|
11 | 11 |
<property name="hibernate.hbm2ddl.auto">create</property> |
12 | 12 |
<property name="show_sql">true</property> |
13 | 13 |
<property name="connection.pool_size">1</property> |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/service/dao/ProjectDAO.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.goldoa.service.dao; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.goldoa.domain.*; |
4 |
import org.hibernate.Criteria; |
|
5 | 4 |
import org.hibernate.criterion.*; |
6 |
import org.springframework.jdbc.core.JdbcTemplate; |
|
7 | 5 |
import org.springframework.stereotype.Repository; |
8 | 6 |
|
9 |
import java.sql.Types; |
|
10 | 7 |
import java.util.ArrayList; |
11 | 8 |
import java.util.Calendar; |
12 | 9 |
import java.util.Date; |
... | ... | |
50 | 47 |
List<Project> prs = createEntityCriteria().add(d).list(); |
51 | 48 |
List<Vocabulary> voc = new ArrayList<>(); |
52 | 49 |
for(Project p : prs) |
53 |
voc.add(new Vocabulary(p.getId(), p.getAcronym() + " - " + p.getGrant() + " (" + p.getTitle() + ")"));
|
|
50 |
voc.add(new Vocabulary(p.getId(), p.getAcronym() + " - " + p.getGr() + " (" + p.getTitle() + ")")); |
|
54 | 51 |
return voc; |
55 | 52 |
|
56 | 53 |
} |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/service/utils/EmailUtilsImpl.java | ||
---|---|---|
73 | 73 |
"\n" + |
74 | 74 |
"We have received a request to fund for the following:\n" + |
75 | 75 |
"\n" + |
76 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
76 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
77 | 77 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
78 | 78 |
|
79 | 79 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
109 | 109 |
"\n" + |
110 | 110 |
"We have received a request to fund for the following:\n" + |
111 | 111 |
"\n" + |
112 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
112 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
113 | 113 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
114 | 114 |
|
115 | 115 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
154 | 154 |
"\n" + |
155 | 155 |
"A new request has been submitted that needs your intervention:\n" + |
156 | 156 |
"\n" + |
157 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
157 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
158 | 158 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
159 | 159 |
|
160 | 160 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
186 | 186 |
"\n" + |
187 | 187 |
"The following request is eligible and has been initially approved for funding but you must edit it before its final approval. Please, see the moderator's comments below.\n" + |
188 | 188 |
"\n" + |
189 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
189 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
190 | 190 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
191 | 191 |
|
192 | 192 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
222 | 222 |
"\n" + |
223 | 223 |
"The following request is eligible and has been approved for funding:\n" + |
224 | 224 |
"\n" + |
225 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
225 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
226 | 226 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
227 | 227 |
|
228 | 228 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
259 | 259 |
"\n" + |
260 | 260 |
"The following request has been rejected:\n" + |
261 | 261 |
"\n" + |
262 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
262 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
263 | 263 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
264 | 264 |
|
265 | 265 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
484 | 484 |
"\n" + |
485 | 485 |
"The following request has been approved for funding but we are missing the invoice:\n" + |
486 | 486 |
"\n" + |
487 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
487 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
488 | 488 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
489 | 489 |
|
490 | 490 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
548 | 548 |
|
549 | 549 |
text += "The following request by " + request.getUser().getFirstname() + " " + request.getUser().getLastname() + " has been approved for funding but we are missing the invoice:\n" + |
550 | 550 |
"\n" + |
551 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
551 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
552 | 552 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
553 | 553 |
|
554 | 554 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
596 | 596 |
"\n" + |
597 | 597 |
"The following request has been approved for funding:\n" + |
598 | 598 |
"\n" + |
599 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
599 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
600 | 600 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
601 | 601 |
|
602 | 602 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
628 | 628 |
"\n" + |
629 | 629 |
"The following request has been completed and APCs have been paid:\n" + |
630 | 630 |
"\n" + |
631 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
631 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
632 | 632 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
633 | 633 |
|
634 | 634 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
667 | 667 |
"\n" + |
668 | 668 |
"The following request has been completed and APCs have been paid:\n" + |
669 | 669 |
"\n" + |
670 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
670 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
671 | 671 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
672 | 672 |
|
673 | 673 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
723 | 723 |
"The following request has been completed and APCs have been paid:\n" + |
724 | 724 |
"\n" + |
725 | 725 |
"Invoice #: " + request.getInvoice().getNumber() + "\n" + |
726 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
726 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
727 | 727 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
728 | 728 |
|
729 | 729 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
764 | 764 |
"The following request has been completed and APCs have been paid:\n" + |
765 | 765 |
"\n" + |
766 | 766 |
"Invoice #: " + request.getInvoice().getNumber() + "\n" + |
767 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
767 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
768 | 768 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
769 | 769 |
|
770 | 770 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
798 | 798 |
"\n" + |
799 | 799 |
"The following request has been put on hold by our accounting office:\n" + |
800 | 800 |
"\n" + |
801 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
801 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
802 | 802 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
803 | 803 |
|
804 | 804 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
832 | 832 |
"\n" + |
833 | 833 |
"The following request has been put on hold by our accounting office:\n" + |
834 | 834 |
"\n" + |
835 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
835 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
836 | 836 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
837 | 837 |
|
838 | 838 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
908 | 908 |
"The following request has been put on hold by our accounting office:\n" + |
909 | 909 |
"\n" + |
910 | 910 |
"Invoice #: " + request.getInvoice().getNumber() + "\n" + |
911 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
911 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
912 | 912 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
913 | 913 |
|
914 | 914 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
944 | 944 |
"\n" + |
945 | 945 |
"The following request has been denied payment by our accounting office:\n" + |
946 | 946 |
"\n" + |
947 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
947 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
948 | 948 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
949 | 949 |
|
950 | 950 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
978 | 978 |
"\n" + |
979 | 979 |
"The following request has been denied payment by our accounting office:\n" + |
980 | 980 |
"\n" + |
981 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
981 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
982 | 982 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
983 | 983 |
|
984 | 984 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
1008 | 1008 |
"\n" + |
1009 | 1009 |
"The following request is being processed by our accounting office:\n" + |
1010 | 1010 |
"\n" + |
1011 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
1011 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
1012 | 1012 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
1013 | 1013 |
|
1014 | 1014 |
if (request.getPublication().getJournal() != null) { |
... | ... | |
1038 | 1038 |
"\n" + |
1039 | 1039 |
"The invoice for the following request has been uploaded:\n" + |
1040 | 1040 |
"\n" + |
1041 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGrant() + "\n" +
|
|
1041 |
"Project: " + request.getProject().getAcronym() + " - " + request.getProject().getGr() + "\n" + |
|
1042 | 1042 |
"Publication: " + request.getPublication().getTitle() + "\n"; // TODO add authors |
1043 | 1043 |
|
1044 | 1044 |
if (request.getPublication().getJournal() != null) { |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Comment.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
@OneToOne |
27 | 27 |
//@JoinColumn(name = "user",columnDefinition = "text default 'portal::ac6219edefc92a45b233f83e975102ec'") |
28 |
@JoinColumn(name = "user")
|
|
28 |
@JoinColumn(name = "\"user\"")
|
|
29 | 29 |
private User user; |
30 | 30 |
|
31 | 31 |
@OneToOne |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Journal.java | ||
---|---|---|
15 | 15 |
@NamedQuery(name="Journal.findAll", query="SELECT j FROM Journal j") |
16 | 16 |
public class Journal implements Serializable { |
17 | 17 |
private static final long serialVersionUID = 1L; |
18 |
|
|
18 |
|
|
19 |
@Id |
|
19 | 20 |
//@Column(columnDefinition = "text") |
21 |
private String id; |
|
22 |
//@Column(columnDefinition = "text") |
|
20 | 23 |
private String alttitle; |
21 | 24 |
//@Column(columnDefinition = "float default 0") |
22 | 25 |
private float apc; |
23 |
//@Column(name="apc_currency",columnDefinition = "text default 'EUR'") |
|
26 |
|
|
24 | 27 |
@Basic |
25 | 28 |
@Convert( converter=CurrencyConverter.class ) |
26 |
private Currency apcCurrency; |
|
29 |
private Currency apcCurrency = Currency.EUR;
|
|
27 | 30 |
//@Column(columnDefinition = "float default 0") |
28 | 31 |
private float discount; |
29 | 32 |
//@Column(columnDefinition = "text") |
... | ... | |
51 | 54 |
@OneToOne |
52 | 55 |
@JoinColumn(name = "language") |
53 | 56 |
private Language language ; |
54 |
|
|
55 |
@Id |
|
56 |
//@Column(columnDefinition = "text") |
|
57 |
private String id; |
|
58 |
|
|
57 |
|
|
59 | 58 |
@OneToOne |
60 | 59 |
@JoinColumn(name = "publisher") |
61 | 60 |
private Publisher publisher; |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/RequestComment.java | ||
---|---|---|
20 | 20 |
|
21 | 21 |
@Id |
22 | 22 |
@ManyToOne |
23 |
@JoinColumn(name = "user")
|
|
23 |
@JoinColumn(name = "\"user\"")
|
|
24 | 24 |
private User user; |
25 | 25 |
|
26 | 26 |
@Id |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Affiliation.java | ||
---|---|---|
11 | 11 |
@Table(name="Affiliation") |
12 | 12 |
@AssociationOverrides({ |
13 | 13 |
@AssociationOverride(name = "pk.user", |
14 |
joinColumns = @JoinColumn(name = "user")),
|
|
14 |
joinColumns = @JoinColumn(name = "\"user\"")),
|
|
15 | 15 |
@AssociationOverride(name = "pk.organization", |
16 | 16 |
joinColumns = @JoinColumn(name = "organization")) }) |
17 | 17 |
public class Affiliation implements Serializable { |
... | ... | |
59 | 59 |
|
60 | 60 |
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
61 | 61 |
@JoinTable(name = "publication_affiliation", joinColumns = { |
62 |
@JoinColumn(name = "user", nullable = false, updatable = false),
|
|
62 |
@JoinColumn(name = "\"user\"", nullable = false, updatable = false),
|
|
63 | 63 |
@JoinColumn(name = "organization", nullable = false, updatable = false)}, |
64 | 64 |
inverseJoinColumns = { @JoinColumn(name = "publication", |
65 | 65 |
nullable = false, updatable = false) }) |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/AccountAction.java | ||
---|---|---|
29 | 29 |
private String type; |
30 | 30 |
|
31 | 31 |
@OneToOne |
32 |
@JoinColumn(name = "user")
|
|
32 |
@JoinColumn(name = "\"user\"")
|
|
33 | 33 |
private User user; |
34 | 34 |
|
35 | 35 |
public User getUser() { |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Project.java | ||
---|---|---|
45 | 45 |
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
46 | 46 |
@JoinTable(name = "project_coordinator", joinColumns = { |
47 | 47 |
@JoinColumn(name = "project", nullable = false, updatable = false)}, |
48 |
inverseJoinColumns = { @JoinColumn(name = "user",
|
|
48 |
inverseJoinColumns = {@JoinColumn(name = "\"user\"",
|
|
49 | 49 |
nullable = false, updatable = false) }) |
50 | 50 |
private List<User> coordinators = new ArrayList<>(); |
51 | 51 |
|
... | ... | |
57 | 57 |
private List<Organization> organizations = new ArrayList<>(); |
58 | 58 |
|
59 | 59 |
//@Column(columnDefinition = "text") |
60 |
private String grant; |
|
60 |
//TODO gr problem as user in postgres |
|
61 |
private String gr; |
|
61 | 62 |
|
62 | 63 |
public Project() { |
63 | 64 |
} |
... | ... | |
102 | 103 |
this.fundingstream = fundingstream; |
103 | 104 |
} |
104 | 105 |
|
105 |
public String getGrant() {
|
|
106 |
return this.grant;
|
|
106 |
public String getGr() { |
|
107 |
return this.gr; |
|
107 | 108 |
} |
108 | 109 |
|
109 |
public void setGrant(String grant) {
|
|
110 |
this.grant = grant;
|
|
110 |
public void setGr(String gr) {
|
|
111 |
this.gr = gr;
|
|
111 | 112 |
} |
112 | 113 |
|
113 | 114 |
public String getId() { |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Budget.java | ||
---|---|---|
107 | 107 |
private Publisher publisher; |
108 | 108 |
|
109 | 109 |
@OneToOne |
110 |
@JoinColumn(name = "user")
|
|
110 |
@JoinColumn(name = "\"user\"")
|
|
111 | 111 |
private User user; |
112 | 112 |
|
113 | 113 |
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
modules/uoa-goldoa-service/branches/hibernate/src/main/java/eu/dnetlib/goldoa/domain/Request.java | ||
---|---|---|
129 | 129 |
private RequestStatus status; |
130 | 130 |
|
131 | 131 |
@OneToOne |
132 |
@JoinColumn(name = "user")
|
|
132 |
@JoinColumn(name = "\"user\"")
|
|
133 | 133 |
private User user; |
134 | 134 |
|
135 | 135 |
@OneToMany(mappedBy = "pk.request",cascade=CascadeType.ALL) |
Also available in: Unified diff