Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
444ddf80
Commit
444ddf80
authored
Jan 11, 2019
by
Maxym Borodenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove AuditedModel class
parent
f1ac09ae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
118 deletions
+119
-118
src/main/java/org/genesys2/server/model/AuditedModel.java
src/main/java/org/genesys2/server/model/AuditedModel.java
+0
-95
src/main/java/org/genesys2/server/model/impl/Article.java
src/main/java/org/genesys2/server/model/impl/Article.java
+5
-5
src/main/java/org/genesys2/server/model/impl/ITPGRFAStatus.java
...in/java/org/genesys2/server/model/impl/ITPGRFAStatus.java
+5
-5
src/main/java/org/genesys2/server/model/impl/Organization.java
...ain/java/org/genesys2/server/model/impl/Organization.java
+5
-5
src/main/java/org/genesys2/server/model/impl/VerificationToken.java
...ava/org/genesys2/server/model/impl/VerificationToken.java
+5
-5
src/main/java/org/genesys2/server/service/filter/ArticleFilter.java
...ava/org/genesys2/server/service/filter/ArticleFilter.java
+3
-3
src/main/resources/liquibase/liquibase-changeLog.yml
src/main/resources/liquibase/liquibase-changeLog.yml
+96
-0
No files found.
src/main/java/org/genesys2/server/model/AuditedModel.java
deleted
100644 → 0
View file @
f1ac09ae
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.server.model
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.MappedSuperclass
;
import
org.genesys.blocks.model.BasicModel
;
import
org.genesys.blocks.util.JsonSidConverter
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldIndex
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty.Access
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
@MappedSuperclass
public
abstract
class
AuditedModel
extends
BasicModel
{
private
static
final
long
serialVersionUID
=
-
5927214471682331909L
;
@CreatedBy
@JsonSerialize
(
converter
=
JsonSidConverter
.
class
)
@Field
(
type
=
FieldType
.
String
,
index
=
FieldIndex
.
not_analyzed
)
@JsonProperty
(
access
=
Access
.
READ_ONLY
)
private
Long
createdBy
;
@CreatedDate
@Column
(
name
=
"createdDate"
)
private
Date
createdDate
;
@LastModifiedBy
@JsonSerialize
(
converter
=
JsonSidConverter
.
class
)
@Field
(
type
=
FieldType
.
String
,
index
=
FieldIndex
.
not_analyzed
)
@JsonProperty
(
access
=
Access
.
READ_ONLY
)
private
Long
lastModifiedBy
;
@LastModifiedDate
@Column
(
name
=
"lastModifiedDate"
)
private
Date
lastModifiedDate
;
public
Long
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedBy
(
Long
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
Date
getCreatedDate
()
{
return
createdDate
;
}
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
public
Long
getLastModifiedBy
()
{
return
lastModifiedBy
;
}
public
void
setLastModifiedBy
(
Long
lastModifiedBy
)
{
this
.
lastModifiedBy
=
lastModifiedBy
;
}
public
Date
getLastModifiedDate
()
{
return
lastModifiedDate
;
}
public
void
setLastModifiedDate
(
Date
lastModifiedDate
)
{
this
.
lastModifiedDate
=
lastModifiedDate
;
}
}
src/main/java/org/genesys2/server/model/impl/Article.java
View file @
444ddf80
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
9
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.model.impl
;
...
...
@@ -29,13 +29,13 @@ import javax.persistence.TemporalType;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
org.genesys.blocks.model.AuditedVersionedModel
;
import
org.genesys.blocks.model.ClassPK
;
import
org.genesys2.server.model.AuditedModel
;
import
org.hibernate.annotations.Type
;
@Entity
@Table
(
name
=
"article"
)
public
class
Article
extends
AuditedModel
{
public
class
Article
extends
Audited
Versioned
Model
{
private
static
final
long
serialVersionUID
=
8690395020204070378L
;
...
...
src/main/java/org/genesys2/server/model/impl/ITPGRFAStatus.java
View file @
444ddf80
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
9
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.model.impl
;
...
...
@@ -23,14 +23,14 @@ import javax.persistence.OneToOne;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.genesys
2.server.model.Audit
edModel
;
import
org.genesys
.blocks.model.AuditedVersion
edModel
;
/**
* Current country status in the ITPGRFA.
*/
@Entity
@Table
(
name
=
"itpgrfa"
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
"ITPGRFA_Country"
,
columnNames
=
{
"countryId"
})
})
public
class
ITPGRFAStatus
extends
AuditedModel
{
public
class
ITPGRFAStatus
extends
Audited
Versioned
Model
{
private
static
final
long
serialVersionUID
=
2766536505832914090L
;
...
...
src/main/java/org/genesys2/server/model/impl/Organization.java
View file @
444ddf80
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
9
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.model.impl
;
...
...
@@ -29,14 +29,14 @@ import javax.persistence.ManyToMany;
import
javax.persistence.OrderBy
;
import
javax.persistence.Table
;
import
org.genesys
2.server.model.Audit
edModel
;
import
org.genesys
.blocks.model.AuditedVersion
edModel
;
import
org.hibernate.annotations.Type
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
@Entity
@Table
(
name
=
"organization"
)
public
class
Organization
extends
AuditedModel
{
public
class
Organization
extends
Audited
Versioned
Model
{
private
static
final
long
serialVersionUID
=
2710908645431936666L
;
...
...
src/main/java/org/genesys2/server/model/impl/VerificationToken.java
View file @
444ddf80
/*
*
* Copyright 201
4
Global Crop Diversity Trust
/*
* Copyright 201
9
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
/
*/
package
org.genesys2.server.model.impl
;
...
...
@@ -24,14 +24,14 @@ import javax.persistence.Entity;
import
javax.persistence.PrePersist
;
import
javax.persistence.Table
;
import
org.genesys
2.server.model.Audit
edModel
;
import
org.genesys
.blocks.model.AuditedVersion
edModel
;
/**
*
*/
@Entity
@Table
(
name
=
"verificationtoken"
)
public
class
VerificationToken
extends
AuditedModel
{
public
class
VerificationToken
extends
Audited
Versioned
Model
{
private
static
final
long
serialVersionUID
=
5031164157223780739L
;
...
...
src/main/java/org/genesys2/server/service/filter/ArticleFilter.java
View file @
444ddf80
...
...
@@ -23,7 +23,7 @@ import java.util.Set;
import
com.hazelcast.util.CollectionUtil
;
import
com.querydsl.core.BooleanBuilder
;
import
com.querydsl.core.types.Predicate
;
import
org.genesys.blocks.model.filters.
Basic
ModelFilter
;
import
org.genesys.blocks.model.filters.
AuditedVersioned
ModelFilter
;
import
org.genesys.blocks.model.filters.StringFilter
;
import
org.genesys2.server.model.impl.Article
;
import
org.genesys2.server.model.impl.QArticle
;
...
...
@@ -31,7 +31,7 @@ import org.genesys2.server.model.impl.QArticle;
/**
* Filters for {@link Article}
*/
public
class
ArticleFilter
extends
Basic
ModelFilter
<
ArticleFilter
,
Article
>
{
public
class
ArticleFilter
extends
AuditedVersioned
ModelFilter
<
ArticleFilter
,
Article
>
{
/** The language. */
public
Set
<
String
>
lang
;
...
...
@@ -57,7 +57,7 @@ public class ArticleFilter extends BasicModelFilter<ArticleFilter, Article> {
*/
public
Predicate
buildQuery
(
QArticle
article
)
{
final
BooleanBuilder
and
=
new
BooleanBuilder
();
super
.
buildQuery
(
article
,
article
.
_super
.
_super
,
and
);
super
.
buildQuery
(
article
,
article
.
_super
.
_super
.
_super
,
and
);
if
(
CollectionUtil
.
isNotEmpty
(
lang
))
{
and
.
and
(
article
.
lang
.
in
(
lang
));
...
...
src/main/resources/liquibase/liquibase-changeLog.yml
View file @
444ddf80
...
...
@@ -4644,3 +4644,99 @@ databaseChangeLog:
-
sql
:
comment
:
Assign activitypost.version
sql
:
update activitypost set version = 1 where version = 0;
-
changeSet
:
id
:
1547202185383-1
author
:
mborodenko
comment
:
Add `active` and `version` to Article
changes
:
-
addColumn
:
tableName
:
article
columns
:
-
column
:
constraints
:
nullable
:
false
defaultValue
:
0
name
:
version
type
:
INT
-
column
:
constraints
:
nullable
:
false
defaultValue
:
true
name
:
active
type
:
BIT(1)
-
sql
:
comment
:
Assign article.version
sql
:
update article set version = 1 where version = 0;
-
changeSet
:
id
:
1547202185383-2
author
:
mborodenko
comment
:
Add `active` and `version` to ITPGRFAStatus
changes
:
-
addColumn
:
tableName
:
itpgrfa
columns
:
-
column
:
constraints
:
nullable
:
false
defaultValue
:
0
name
:
version
type
:
INT
-
column
:
constraints
:
nullable
:
false
defaultValue
:
true
name
:
active
type
:
BIT(1)
-
sql
:
comment
:
Assign itpgrfa.version
sql
:
update itpgrfa set version = 1 where version = 0;
-
changeSet
:
id
:
1547202185383-3
author
:
mborodenko
comment
:
Add `active` and `version` to VerificationToken
changes
:
-
addColumn
:
tableName
:
verificationtoken
columns
:
-
column
:
constraints
:
nullable
:
false
defaultValue
:
0
name
:
version
type
:
INT
-
column
:
constraints
:
nullable
:
false
defaultValue
:
true
name
:
active
type
:
BIT(1)
-
sql
:
comment
:
Assign verificationtoken.version
sql
:
update verificationtoken set version = 1 where version = 0;
-
changeSet
:
id
:
1547202185383-4
author
:
mborodenko
comment
:
Add `active` and `version` to Organization
changes
:
-
addColumn
:
tableName
:
organization
columns
:
-
column
:
constraints
:
nullable
:
false
defaultValue
:
0
name
:
version
type
:
INT
-
column
:
constraints
:
nullable
:
false
defaultValue
:
true
name
:
active
type
:
BIT(1)
-
sql
:
comment
:
Assign organization.version
sql
:
update organization set version = 1 where version = 0;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment