Code: Select all
Organization organization = jooq().select().from(ORGANIZATION).fetchOne().into(Organization.class);
< /code>
Das Problem, das ich habe, ist, dass ich nicht wirklich verstehen kann, was in DeFaultRecordMapper passiert, da ich das Gefühl habe, dass ich mit allen verwendeten Begriffen nicht ganz vertraut bin. Ich versuche herauszufinden, wie es für die Hibernate -Klassen in meiner Codebasis gilt. Hibernate -Modell.
[*] add @column
Code: Select all
id< /code> Feld wird korrekt abgebildet.name
Code: Select all
null
[*]
Code: Select all
createdAt
Code: Select all
null
Meine Frage lautet: Gibt es etwas, das ich mit der Zuordnung übersehen kann und welche Dinge ich in Bezug auf die Klassen, Felder, Konstrukteure und Annotationen mit Hibernate -Modellen betrachten sollte? Ich möchte irgendwann alle Hibernate -Modelle in der Codebasis zuordnen und dazu Fetchinto verwenden.
Danke!

Code: Select all
@Entity
public class Organization extends BaseModel {
@Required public String name;
//... a lot of other code
}
< /code>
@MappedSuperclass
public class BaseModel extends Model {
/** The datetime this entity was first saved. Automatically set by a JPA prePersist */
@NoBinding
@Column
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
public DateTime createdAt;
/** The datetime this entity was last modified. Automatically set by a JPA preUpdate */
@NoBinding
@Column
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
public DateTime modifiedAt;
//...
}
< /code>
@MappedSuperclass
public class Model extends GenericModel { // Both Model and GenericModel are from the Play Framework
@Id
@GeneratedValue
public Long id;
public Model() {
}
public Long getId() {
return this.id;
}
public Object _key() {
return this.getId();
}
}