Skip to content

Commit

Permalink
OGM-1215 Remove [classname] from documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD authored and gsmet committed Jan 3, 2017
1 parent 9cb5282 commit c07a8e1
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 178 deletions.
Expand Up @@ -7,7 +7,7 @@
[NOTE]
====
Hibernate OGM defines an abstraction layer
represented by [classname]`DatastoreProvider` and [classname]`GridDialect`
represented by `DatastoreProvider` and `GridDialect`
to separate the OGM engine from the datastores interaction.
It has successfully abstracted various key/value stores, document stores and graph databases.
We are working on testing it on other NoSQL families.
Expand Down Expand Up @@ -40,18 +40,18 @@ image::ogm-architecture.png[align="center", depth="", scalefit="1", width="15cm"

Hibernate OGM reuses as much as possible from the Hibernate ORM infrastructure.
There is no need to rewrite a new JPA engine.
The [classname]``Persister``s and the [classname]``Loader``s
The ``Persister``s and the ``Loader``s
(two interfaces used by Hibernate ORM)
have been rewritten to persist data in the NoSQL store.
These implementations are the core of Hibernate OGM.
We will see in <<ogm-architecture-datapersisted>> how the data is structured.

The particularities between NoSQL stores are abstracted
by the notion of a [classname]`DatastoreProvider` and a [classname]`GridDialect`.
by the notion of a `DatastoreProvider` and a `GridDialect`.

* [classname]`DatastoreProvider` abstracts how to start
* `DatastoreProvider` abstracts how to start
and maintain a connection between Hibernate OGM and the datastore.
* [classname]`GridDialect` abstracts how data itself including associations
* `GridDialect` abstracts how data itself including associations
are persisted.


Expand Down Expand Up @@ -83,7 +83,7 @@ in more details in <<ogm-architecture-dataqueried>>.

Hibernate OGM best works in a JTA environment.
The easiest solution is to deploy it on a Java EE container.
Alternatively, you can use a standalone JTA [classname]`TransactionManager`.
Alternatively, you can use a standalone JTA `TransactionManager`.
We explain how to in <<ogm-configuration-environments-standalonejta>>.

Let's now see how and in which structure data is persisted in the NoSQL data store.
Expand Down Expand Up @@ -221,12 +221,12 @@ to find the specificities.

Many NoSQL stores have no notion of schema.
Likewise, the tuple stored by Hibernate OGM is not tied to a particular schema:
the tuple is represented by a [classname]`Map`,
not a typed [classname]`Map` specific to a given entity type.
the tuple is represented by a `Map`,
not a typed `Map` specific to a given entity type.
Nevertheless, JPA does describe a schema thanks to:

* the class schema
* the JPA physical annotations like [classname]`@Table` and [classname]`@Column`.
* the JPA physical annotations like `@Table` and `@Column`.


While tied to the application, it offers some robustness and explicit understanding
Expand All @@ -240,15 +240,15 @@ and the totally schema-less approach pushed by some NoSQL families.

You can use sequences with the following annotations:

* [classname]`@SequenceGenerator`:
* `@SequenceGenerator`:
it will use native sequences if available
* [classname]`@TableGenerator`:
* `@TableGenerator`:
it will emulate sequences storing the value in the most appropriate data structure;
for example a document in MongoDB or a node in Neo4j.

Here's some things to keep in mind when dealing with sequence generation:

* [classname]`@TableGenerator` is the fallback approach used when the underlying datastore does not
* `@TableGenerator` is the fallback approach used when the underlying datastore does not
support native sequences generation.
* If the datastore does not support atomic operations and does not support native sequences,
Hibernate OGM will throw an exception at bootstrap and suggest alternatives.
Expand Down
Expand Up @@ -113,7 +113,7 @@ CQL3 does not have a Calendar type, so these are converted to Dates, which are s
===== Identifier generation strategies

You can assign id values yourself or let Hibernate OGM generate the value using the
[classname]`@GeneratedValue` annotation.
`@GeneratedValue` annotation.

The preferred identifier approach in Cassandra is to use UUIDs.

Expand All @@ -127,7 +127,7 @@ Cassandra does not distinguish between update and insert operations and will not

=== Native queries

Native queries are supported: you can execute native CQL queries using the [classname]`EntityManager` infrastructure.
Native queries are supported: you can execute native CQL queries using the `EntityManager` infrastructure.

Currently, only ordinal parameters are supported, named parameters do not work.

Expand Down
Expand Up @@ -7,8 +7,8 @@ This makes its configuration quite simple by default.

=== Bootstrapping Hibernate OGM

Hibernate OGM can be used via the Hibernate native APIs ([classname]`Session`)
or via the JPA APIs ([classname]`EntityManager`).
Hibernate OGM can be used via the Hibernate native APIs (`Session`)
or via the JPA APIs (`EntityManager`).
Depending on your choice, the bootstrapping strategy is slightly different.

==== Using JPA
Expand All @@ -17,7 +17,7 @@ If you use JPA as your primary API, the configuration is extremely simple.
Hibernate OGM is seen as a persistence provider
which you need to configure in your [filename]`persistence.xml`.
That's it!
The provider name is [classname]`org.hibernate.ogm.jpa.HibernateOgmPersistence`.
The provider name is `org.hibernate.ogm.jpa.HibernateOgmPersistence`.

.persistence.xml file
====
Expand Down Expand Up @@ -66,8 +66,8 @@ but you could of course change the Infinispan configuration to enable clustering

From there, simply bootstrap JPA the way you are used to with Hibernate ORM:

* via [classname]`Persistence.createEntityManagerFactory`
* by injecting the [classname]`EntityManager` / [classname]`EntityManagerFactory` in a Java EE container
* via `Persistence.createEntityManagerFactory`
* by injecting the `EntityManager` / `EntityManagerFactory` in a Java EE container
* by using your favorite injection framework (CDI - Weld, Spring, Guice)

[NOTE]
Expand Down Expand Up @@ -209,7 +209,7 @@ In Hibernate OGM, make sure to set the following properties:

* `transaction-type` to `JTA` in your persistence.xml if you use JPA
* or `hibernate.transaction.coordinator_class` to "jta"
if you use [classname]`StandardServiceRegistryBuilder`/[classname]`OgmConfiguration` to bootstrap Hibernate OGM.
if you use `StandardServiceRegistryBuilder`/`OgmConfiguration` to bootstrap Hibernate OGM.
* `hibernate.transaction.jta.platform` to `JBossTS` in both cases.


Expand Down
Expand Up @@ -230,21 +230,21 @@ in the corresponding object in the db.

Hibernate OGM support by default the following types:

* [classname]`java.lang.String`
* `java.lang.String`

[source, JSON]
----
{ "text" : "Hello world!" }
----

* [classname]`java.lang.Character` (or char primitive)
* `java.lang.Character` (or char primitive)

[source, JSON]
----
{ "delimiter" : "/" }
----

* [classname]`java.lang.Boolean` (or boolean primitive)
* `java.lang.Boolean` (or boolean primitive)

[source, JSON]
----
Expand All @@ -254,84 +254,84 @@ Hibernate OGM support by default the following types:
{ "favorite" : 1 } # if @Type(type = "numeric_boolean") is given
----

* [classname]`java.lang.Byte` (or byte primitive)
* `java.lang.Byte` (or byte primitive)

[source, JSON]
----
{ "display_mask" : "70" }
----

* [classname]`java.lang.Short` (or short primitive)
* `java.lang.Short` (or short primitive)

[source, JSON]
----
{ "urlPort" : 80 }
----

* [classname]`java.lang.Integer` (or int primitive)
* `java.lang.Integer` (or int primitive)

[source, JSON]
----
{ "stockCount" : 12309 }
----

* [classname]`java.lang.Long` (or long primitive)
* `java.lang.Long` (or long primitive)

[source, JSON]
----
{ "userId" : "-6718902786625749549" }
----

* [classname]`java.lang.Float` (or float primitive)
* `java.lang.Float` (or float primitive)

[source, JSON]
----
{ "visitRatio" : 10.4 }
----

* [classname]`java.lang.Double` (or double primitive)
* `java.lang.Double` (or double primitive)

[source, JSON]
----
{ "tax_percentage" : 12.34 }
----

* [classname]`java.math.BigDecimal`
* `java.math.BigDecimal`

[source, JSON]
----
{ "site_weight" : "21.77" }
----

* [classname]`java.math.BigInteger`
* `java.math.BigInteger`

[source, JSON]
----
{ "site_weight" : "444" }
----

* [classname]`java.util.Calendar`
* `java.util.Calendar`

[source, JSON]
----
{ "creation" : "2014-11-18T15:51:26.252Z" }
----

* [classname]`java.util.Date`
* `java.util.Date`

[source, JSON]
----
{ "last_update" : "2014-11-18T15:51:26.252Z" }
----

* [classname]`java.util.UUID`
* `java.util.UUID`

[source, JSON]
----
{ "serialNumber" : "71f5713d-69c4-4b62-ad15-aed8ce8d10e0" }
----

* [classname]`java.util.URL`
* `java.util.URL`

[source, JSON]
----
Expand All @@ -342,7 +342,7 @@ Hibernate OGM support by default the following types:

Entities are stored as CouchDB documents and not as BLOBs
which means each entity property will be translated into a document field.
You can use the name property of the [classname]`@Table` and [classname]`@Column` annotations
You can use the name property of the `@Table` and `@Column` annotations
to rename the collections and the document's fields if you need to.

CouchDB provides a built-in mechanism for detecting concurrent updates to one and the same document.
Expand Down Expand Up @@ -509,7 +509,7 @@ public class NewsID implements Serializable {
===== Identifier generation strategies

You can assign id values yourself or let Hibernate OGM generate the value using the
[classname]`@GeneratedValue` annotation.
`@GeneratedValue` annotation.

Two main strategies are supported:

Expand Down Expand Up @@ -715,8 +715,8 @@ public class Song {

===== Embedded objects and collections

Hibernate OGM stores elements annotated with [classname]`@Embedded`
or [classname]`@ElementCollection` as nested documents of the owning entity.
Hibernate OGM stores elements annotated with `@Embedded`
or `@ElementCollection` as nested documents of the owning entity.

.Embedded object
====
Expand Down Expand Up @@ -834,7 +834,7 @@ public class GrandChild {
----
====

The class [classname]`GrandChild` has only one attribute `name`,
The class `GrandChild` has only one attribute `name`,
this means that Hibernate OGM doesn't need to store the name of the attribute.

If the nested document has two or more fields, like in the following example,
Expand Down
Expand Up @@ -64,7 +64,7 @@ Possible values are:
* specific shortcuts (preferable): `map` (only to be used for unit tests),
`infinispan_embedded`, `infinispan_remote`, `ehcache`, `mongodb`, `neo4j_embedded`,
`neo4j_http`, `neo4j_bolt`, `couchdb_experimental` or `redis_experimental`
* the fully qualified class name of a [classname]`DatastoreProvider` implementation
* the fully qualified class name of a `DatastoreProvider` implementation

[NOTE]
====
Expand All @@ -90,7 +90,7 @@ EntityManagerFactory emf = Persistence.createEntityManagerFactory( "my-pu", prop

By default, a datastore provider chooses the grid dialect transparently
but you can override this setting with the `hibernate.ogm.datastore.grid_dialect` option.
Use the fully qualified class name of the [classname]`GridDialect` implementation.
Use the fully qualified class name of the `GridDialect` implementation.
Most users should ignore this setting entirely.

Let's now look at the specifics of each datastore provider.
Expand Down
Expand Up @@ -127,24 +127,24 @@ the key being the column name.

Hibernate OGM supports by default the following property types:

* [classname]`java.lang.String`
* [classname]`java.lang.Character` (or char primitive)
* [classname]`java.lang.Boolean` (or boolean primitive); Optionally the annotations `@Type(type = "true_false")`, `@Type(type = "yes_no")` and `@Type(type = "numeric_boolean")` can be used to map boolean properties to the characters 'T'/'F', 'Y'/'N' or the int values 0/1, respectively.
* [classname]`java.lang.Byte` (or byte primitive)
* [classname]`java.lang.Short` (or short primitive)
* [classname]`java.lang.Integer` (or integer primitive)
* [classname]`java.lang.Long` (or long primitive)
* [classname]`java.lang.Integer` (or integer primitive)
* [classname]`java.lang.Float` (or float primitive)
* [classname]`java.lang.Double` (or double primitive)

* [classname]`java.math.BigDecimal`
* [classname]`java.math.BigInteger`

* [classname]`java.util.Calendar`
* [classname]`java.util.Date`
* [classname]`java.util.UUID`
* [classname]`java.util.URL`
* `java.lang.String`
* `java.lang.Character` (or char primitive)
* `java.lang.Boolean` (or boolean primitive); Optionally the annotations `@Type(type = "true_false")`, `@Type(type = "yes_no")` and `@Type(type = "numeric_boolean")` can be used to map boolean properties to the characters 'T'/'F', 'Y'/'N' or the int values 0/1, respectively.
* `java.lang.Byte` (or byte primitive)
* `java.lang.Short` (or short primitive)
* `java.lang.Integer` (or integer primitive)
* `java.lang.Long` (or long primitive)
* `java.lang.Integer` (or integer primitive)
* `java.lang.Float` (or float primitive)
* `java.lang.Double` (or double primitive)

* `java.math.BigDecimal`
* `java.math.BigInteger`

* `java.util.Calendar`
* `java.util.Date`
* `java.util.UUID`
* `java.util.URL`

[NOTE]
====
Expand Down

0 comments on commit c07a8e1

Please sign in to comment.