BAEL-1107: update properties of Author (#2666)

* Different types of bean injection in Spring

* Difference between two dates in java

* Update README.md

* Simple clean of difference between dates

* Clean my test article

* Improve dates diff: for dates and datetimes

* Move difference between dates from core-java to libraries

* BAEL-890 - Kotlin-Allopen with Spring example

* BAEL-1107 - Introduction to Apache Cayenne Orm

* BAEL-1107: update formating and version of libs

* BAEL-1107: update properties of Author
This commit is contained in:
Dassi orleando
2017-09-24 18:32:50 +01:00
committed by maibin
parent c9072e54d1
commit 52ac2ba2d3
3 changed files with 22 additions and 41 deletions
@@ -19,22 +19,14 @@ public abstract class _Author extends CayenneDataObject {
public static final String ID_PK_COLUMN = "id";
public static final Property<String> FIRSTNAME = Property.create("firstname", String.class);
public static final Property<String> LASTNAME = Property.create("lastname", String.class);
public static final Property<String> NAME = Property.create("name", String.class);
public static final Property<List<Article>> ARTICLES = Property.create("articles", List.class);
public void setFirstname(String firstname) {
writeProperty("firstname", firstname);
public void setName(String name) {
writeProperty("name", name);
}
public String getFirstname() {
return (String)readProperty("firstname");
}
public void setLastname(String lastname) {
writeProperty("lastname", lastname);
}
public String getLastname() {
return (String)readProperty("lastname");
public String getName() {
return (String)readProperty("name");
}
public void addToArticles(Article obj) {
@@ -11,17 +11,15 @@
<db-attribute name="title" type="VARCHAR" isMandatory="true" length="254"/>
</db-entity>
<db-entity name="author" catalog="intro_cayenne">
<db-attribute name="firstname" type="VARCHAR" isMandatory="true" length="254"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isGenerated="true" isMandatory="true" length="10"/>
<db-attribute name="lastname" type="VARCHAR" isMandatory="true" length="254"/>
<db-attribute name="name" type="VARCHAR" isMandatory="true" length="254"/>
</db-entity>
<obj-entity name="Article" className="com.baeldung.apachecayenne.persistent.Article" dbEntityName="article">
<obj-attribute name="content" type="java.lang.String" db-attribute-path="content"/>
<obj-attribute name="title" type="java.lang.String" db-attribute-path="title"/>
</obj-entity>
<obj-entity name="Author" className="com.baeldung.apachecayenne.persistent.Author" dbEntityName="author">
<obj-attribute name="firstname" type="java.lang.String" db-attribute-path="firstname"/>
<obj-attribute name="lastname" type="java.lang.String" db-attribute-path="lastname"/>
<obj-attribute name="name" type="java.lang.String" db-attribute-path="name"/>
</obj-entity>
<db-relationship name="author" source="article" target="author" toMany="false">
<db-attribute-pair source="author_id" target="id"/>