26.2.2.3 日時データにアクセスするためのAPI
グラフ・サーバー(PGX)は、新しいJava 8のTemporalデータ型を使用して、Java APIを介して日時データにアクセスします。
- PGXの
date
はJavaのLocalDate
にマップされます - PGXの
time
はJavaのLocalTime
にマップされます - PGXの
timestamp
はJavaのLocalDateTime
にマップされます - PGXの
time with time zone
はJavaのOffsetTime
にマップされます - PGXの
timestamp with time zone
はJavaのOffsetDateTime
にマップされます
次のコードに示すように日付を取得できます。
opg4j> var dateOfBirthProperty = graph.getVertexProperty("date_of_birth")
opg4j> var birthdayOfJudy = dateOfBirthProperty.get(1)
import java.time.LocalDate;
import oracle.pgx.api.*;
...
VertexProperty<LocalDate> dateOfBirthProperty = graph.getVertexProperty("date_of_birth");
LocalDate birthdayOfJudy = dateOfBirthProperty.get(1);
date_of_birth_property = graph.get_vertex_property("date_of_birth")
birthday_of_judy = date_of_birth_property.get(1)
親トピック: 日時データ型の使用