musicbrainz-data

Java data bindings for the MusicBrainz Database using Hibernate

Лицензия

Лицензия

Категории

Категории

Данные
Группа

Группа

fm.last
Идентификатор

Идентификатор

musicbrainz-data
Последняя версия

Последняя версия

3.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

musicbrainz-data
Java data bindings for the MusicBrainz Database using Hibernate
Ссылка на сайт

Ссылка на сайт

https://github.com/lastfm/musicbrainz-data
Организация-разработчик

Организация-разработчик

Last.fm
Система контроля версий

Система контроля версий

https://github.com/lastfm/musicbrainz-data

Скачать musicbrainz-data

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/fm.last/musicbrainz-data/ -->
<dependency>
    <groupId>fm.last</groupId>
    <artifactId>musicbrainz-data</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/fm.last/musicbrainz-data/
implementation 'fm.last:musicbrainz-data:3.1.0'
// https://jarcasting.com/artifacts/fm.last/musicbrainz-data/
implementation ("fm.last:musicbrainz-data:3.1.0")
'fm.last:musicbrainz-data:jar:3.1.0'
<dependency org="fm.last" name="musicbrainz-data" rev="3.1.0">
  <artifact name="musicbrainz-data" type="jar" />
</dependency>
@Grapes(
@Grab(group='fm.last', module='musicbrainz-data', version='3.1.0')
)
libraryDependencies += "fm.last" % "musicbrainz-data" % "3.1.0"
[fm.last/musicbrainz-data "3.1.0"]

Зависимости

compile (13)

Идентификатор библиотеки Тип Версия
org.hibernate : hibernate-core jar 3.6.9.Final
joda-time : joda-time jar 2.2
joda-time : joda-time-hibernate jar 1.3
com.google.guava : guava jar 14.0.1
org.slf4j : slf4j-api jar 1.7.5
org.apache.commons : commons-lang3 jar 3.1
org.springframework : spring-core jar 3.2.2.RELEASE
org.springframework : spring-expression jar 3.2.2.RELEASE
org.springframework : spring-aop jar 3.2.2.RELEASE
org.springframework : spring-beans jar 3.2.2.RELEASE
org.springframework : spring-context jar 3.2.2.RELEASE
org.springframework : spring-jdbc jar 3.2.2.RELEASE
org.springframework : spring-orm jar 3.2.2.RELEASE

runtime (3)

Идентификатор библиотеки Тип Версия
c3p0 : c3p0 jar 0.9.1.2
postgresql : postgresql jar 9.1-901-1.jdbc4
org.javassist : javassist jar 3.14.0-GA

test (4)

Идентификатор библиотеки Тип Версия
org.hamcrest : hamcrest-library jar 1.3
junit : junit jar 4.11
org.springframework : spring-test jar 3.2.2.RELEASE
org.slf4j : slf4j-log4j12 jar 1.7.5

Модули Проекта

Данный проект не имеет модулей.

musicbrainz-data

Java data bindings for the MusicBrainz Database using Hibernate.

Things to know

  • As of now, musicbrainz-data is meant for read-only access to the MusicBrainz Database. Nothing, however, prevents a user from changing entites; any change might be written to the database and might leave it in an inconsistent state afterwards.
  • Only a subset of the database schema is implemented. Access is provided to artists, releases, tracks and recordings (and related tables).

Configuration

Set some properties for your context

    db.musicbrainz.driver.class=org.postgresql.Driver
    db.musicbrainz.url=jdbc:postgresql://localhost:5432/musicbrainz_db
    db.musicbrainz.user=musicbrainz
    db.musicbrainz.password=musicbrainz

(see src/main/config/musicbrainz-data.properties.example for all available options)

Import the musicbrainz-data Spring context:

    <import resource="spring/musicbrainz-data.xml" />

Add the musicbrainz-data dependency:

    <dependency>
      <groupId>fm.last</groupId>
      <artifactId>musicbrainz-data</artifactId>
      <version>3.0.0</version>
    </dependency>

Usage examples

See the included tests for more examples. The Javadoc can be generated by running mvn javadoc:javadoc.

General pattern

    @Component
    public class ArtistHandler {

      private final ArtistDao artistDao;

      @Autowired
      public ArtistHandler(ArtistDao artistDao) {
        this.artistDao = artistDao;
      }

      @Transactional
      public void process(int id) {
        Artist artist = artistDao.getById(id);
        // ...
      }
    }

Query for all artists named 'MONO' (casing will be ignored)

    List<Artist> artists = artistDao.getByName("mono");

Get release with GID 'c69b70bc-049e-3e3f-a5e4-5a1b4d62105f'

    UUID musicBrainzId = UUID.fromString("c69b70bc-049e-3e3f-a5e4-5a1b4d62105f");
    Release release = releaseDao.getByGid(musicBrainzId);

Running the tests

  • Create an empty database musicbrainz_musicbrainzdata_unittest (as described in the MusicBrainz documentation).
  • Run mvn clean verify

Contributing

All contributions are welcome. Please use the Last.fm codeformatting profile found in the lastfm-oss-config project for formatting your changes.

Contributors

License

Copyright 2013 Last.fm

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.

Kthxbye

Last.fm <3 MusicBrainz

fm.last

Last.fm

Версии библиотеки

Версия
3.1.0
3.0.0
2.0.0
1.3
1.2