strix

A lightweight and simple transaction library

Лицензия

Лицензия

Группа

Группа

io.mcarle
Идентификатор

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

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

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

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

strix
A lightweight and simple transaction library
Ссылка на сайт

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

https://github.com/mcarleio/strix
Система контроля версий

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

https://github.com/mcarleio/strix

Скачать strix

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

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
pl.touk : throwing-function jar 1.3
org.aspectj : aspectjrt jar 1.8.13
org.slf4j : slf4j-api jar 1.7.25

provided (1)

Идентификатор библиотеки Тип Версия
org.hibernate.javax.persistence : hibernate-jpa-2.1-api jar 1.0.0.Final

test (5)

Идентификатор библиотеки Тип Версия
org.hibernate : hibernate-core jar 5.2.12.Final
org.apache.logging.log4j : log4j-core jar 2.10.0
org.apache.logging.log4j : log4j-slf4j-impl jar 2.10.0
com.h2database : h2 jar 1.4.196
junit : junit jar 4.12

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

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

STRIX

Strix

A lightweight and simple transaction library for non JEE projects.

Maven Central License Build status Build status Code Quality

Simple Usage

You can find a simple example project under example. In short terms you have to:

  1. Include strix as dependency

    <dependency>
        <groupId>io.mcarle</groupId>
        <artifactId>strix</artifactId>
        <version>1.0.1</version>
    </dependency>
  2. Include aspectj-maven-plugin and define strix as aspectLibrary

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.10</version>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                    <goal>test-compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <complianceLevel>${maven.compiler.source}</complianceLevel>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <aspectLibraries>
                <aspectLibrary>
                    <groupId>io.mcarle</groupId>
                    <artifactId>strix</artifactId>
                </aspectLibrary>
            </aspectLibraries>
        </configuration>
    </plugin>
  3. Start strix before you call any transactional methods

    import io.mcarle.strix.Strix;
    import org.glassfish.jersey.servlet.ServletContainer;
    
    public class ExampleServlet extends ServletContainer {
    
        @Override
        public void destroy() {
            super.destroy();
            Strix.shutdown();
        }
    
        @Override
        public void init() throws ServletException {
            Strix.startup();
            super.init();
        }
    }
  4. Annotate your classes or methods, which should be transactional with strix's @Transactional-Annotation like

    import io.mcarle.strix.annotation.Transactional;
    import static io.mcarle.strix.Strix.em;
    
    @Transactional
    public class ExampleManager {
       public <T> T find(Class<T> entityClass, Long id) {
            return em().find(entityClass, id);
       }
    }

License

Unless explicitly stated otherwise all files in this repository are licensed under the Apache Software License 2.0

Copyright 2017 Marcel Carlé

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.

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

Версия
1.0.1
1.0.0