Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QueryKeyExtractorTest.testTimeDimensionsOrdered #1375

Draft
wants to merge 22 commits into
base: elide-5.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f0d0931
parent a14ccfbb7b558d27799b4e7b1916850519639708
QubitPi Jun 4, 2019
8cdd9dd
Fixed issues with rebase
May 16, 2020
c5a44fc
Finished rebase
May 16, 2020
0bf0b1e
Async ID change from UUID to String and Dynamic Config FIx (#1325)
moizarafat May 18, 2020
315d254
TANDS-19093-transactionRegistry-interface (#1332)
ramshakr May 19, 2020
8990160
add requestId (#1331)
AshishAg24 May 19, 2020
39f9c66
[maven-release-plugin] prepare release 5.0.0-pr9
May 20, 2020
cec7d1e
[maven-release-plugin] prepare for next development iteration
May 20, 2020
0404911
Introduce QueryResult class for QueryEngine caching (#1333)
john-karp May 20, 2020
2f9f56a
remove missing javadoc warnings (#1337)
Chandrasekar-Rajasekar May 21, 2020
c18fabf
Elide 5.x dynamic config standalone (#1259)
AvaniMakwana May 26, 2020
10b118a
addTransaction-removeTransaction (#1338)
Rkr1992 May 28, 2020
aaf621f
Fixed rebase
May 28, 2020
d4623bc
Removed old elide example modules
May 28, 2020
2abbf68
[maven-release-plugin] prepare release 5.0.0-pr10
May 28, 2020
3dc187c
[maven-release-plugin] prepare for next development iteration
May 28, 2020
f0ef023
Validation for Model Configs (#1306)
rishi-aga Jun 1, 2020
46f83b0
add explicit join (#1364)
Chandrasekar-Rajasekar Jun 3, 2020
2853ad4
Fixes - Honor Doc Version in SwaggerController and Use ISO8601Dates S…
moizarafat Jun 4, 2020
f209483
Elide dynamic config model verification (#1354)
AvaniMakwana Jun 10, 2020
af132fd
Add caching support to SQLQueryEngine (#1319)
john-karp Jun 12, 2020
123485d
Fix QueryKeyExtractorTest.testTimeDimensionsOrdered
john-karp Jun 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ dependency-reduced-pom.xml
.project
*/.project
*/*/.project
*.factorypath
*.vscode
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
branches:
only:
- master
- elide-5.x
- "/^[0-9]+\\.[0-9]+(\\.[0-9]+|-(alpha|beta)-[0-9]+)/"

install: true
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ Add Lifecycle hooks to your models to embed custom business logic that execute i
@Include(rootLevel = true)
@ReadPermission("Everyone")
@CreatePermission("Admin OR Publisher")
@DeletePermission("Noone")
@UpdatePermission("Noone")
@DeletePermission("None")
@UpdatePermission("None")
@LifeCycleHookBinding(operation = UPDATE, hook = BookCreationHook.class, phase = PRECOMMIT)
public class Book {

@Id
Expand All @@ -146,9 +147,13 @@ public class Book {

@ManyToMany(mappedBy = "books")
private Set<Author> authors;
}

public class BookCreationHook implements LifeCycleHook<Book> {

@OnCreatePreCommit
public void onCreate(RequestScope scope) {
@Override
public void execute(LifeCycleHookBinding.Operation operation, Book book,
RequestScope requestScope, Optional<ChangeSpec> changes) {
//Do something
}
}
Expand Down
4 changes: 3 additions & 1 deletion checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
<suppressions>
<!-- Suppress generated sources -->
<suppress files="[/\\]src[/\\]test[/\\]" checks="(JavadocType|LineLength|MethodLength)"/>
<suppress files="[/\\]src[/\\]test[/\\]" checks="(JavadocType|LineLength|MethodLength|MethodCount)"/>
<suppress files="[/\\]src[/\\]main[/\\]webapp[/\\]WEB-INF[/\\]api-docs[/\\]" checks=".*"/>
<suppress files="[/\\]target[/\\]" checks=".*"/>
<suppress files="\.csv" checks=".*"/>
<suppress files="\.json" checks="LineLength"/>
<suppress files="\.hbs" checks="LineLength"/>
</suppressions>
3 changes: 1 addition & 2 deletions elide-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.yahoo.elide</groupId>
<artifactId>elide-parent-pom</artifactId>
<version>4.6.5-SNAPSHOT</version>
<version>5.0.0-pr11-SNAPSHOT</version>
</parent>

<licenses>
Expand Down Expand Up @@ -53,5 +53,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2020, Yahoo Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.annotation;

import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* Versions API Models.
*/
@Target({PACKAGE})
@Retention(RUNTIME)
public @interface ApiVersion {

/**
* Models in this package are tied to this API version.
* @return the string (default = "")
*/
String version() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -20,6 +19,5 @@
*/
@Target({METHOD, FIELD, TYPE, PACKAGE})
@Retention(RUNTIME)
@Inherited
public @interface Exclude {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -18,7 +17,6 @@
*/
@Target({TYPE, PACKAGE})
@Retention(RUNTIME)
@Inherited
public @interface Include {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright 2020, Yahoo Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.annotation;

import com.yahoo.elide.functions.LifeCycleHook;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Executes arbitrary logic (a lifecycle hook) when an Elide model is read or written.
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(LifeCycleHookBindings.class)
public @interface LifeCycleHookBinding {

enum Operation {
CREATE,
READ,
UPDATE,
DELETE
};

enum TransactionPhase {
PRESECURITY,
PRECOMMIT,
POSTCOMMIT
}

/**
* The function to invoke when this life cycle triggers.
* @return the function class.
*/
Class<? extends LifeCycleHook> hook();

/**
* Which CRUD operation to trigger on.
* @return CREATE, READ, UPDATE, or DELETE
*/
Operation operation();

/**
* Which transaction phase to trigger on.
* @return PRESECURITY, PRECOMMIT, or POSTCOMMIT
*/
TransactionPhase phase() default TransactionPhase.PRECOMMIT;

/**
* Controls how often the hook is invoked:
* A hook is invoked once per class per request (when bound to the model).
* A hook is invoked once per field per request (when bound to a model field or method).
* A hook is invoked one or more times per class per request (when bound to a model and oncePerRequest is false).
* @return true or false.
*/
boolean oncePerRequest() default true;
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
/*
* Copyright 2016, Yahoo Inc.
* Copyright 2020, Yahoo Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.annotation;


import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* On Delete trigger annotation.
*
* The invoked function takes a RequestScope as parameter.
* @see com.yahoo.elide.security.RequestScope
* A group of repeatable LifeCycleHookBinding annotations.
*/
@Target({ElementType.METHOD})
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface OnDeletePreSecurity {

public @interface LifeCycleHookBindings {
LifeCycleHookBinding[] value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2020, Yahoo Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.annotation;

import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* Marks that the given entity cannot be added to another collection after creation of the entity.
*/
@Target({TYPE, PACKAGE})
@Retention(RUNTIME)
@Inherited
public @interface NonTransferable {

/**
* If NonTransferable is used at the package level, it can be disabled for individual entities by setting
* this flag to false.
* @return true if enabled.
*/
boolean enabled() default true;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.