Skip to content

Commit 660066f

Browse files
committed
Removing custom hints obsolete with Spring Native 0.10.1.
Upgraded to Spring Native 0.10.1 snapshots. Removed explicit proxy configuration for Engine as @async is now automatically detected (spring-attic/spring-native#826). Removed explicit configuration needed for event listeners as they're now supported out of the box (spring-attic/spring-native#828). Declare Money as the type being returned from MonetaryAmountAttributeConverter.convertToEntityAttribute(…) so that it is automatically added to the reflection configuration (makes spring-attic/spring-native#826 obsolete).
1 parent c36abd8 commit 660066f

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
1818
<properties>
1919
<java.version>17</java.version>
2020
<spring-data-bom.version>2021.1.0-SNAPSHOT</spring-data-bom.version>
21-
<spring-native.version>0.10.0</spring-native.version>
21+
<spring-native.version>0.10.1-SNAPSHOT</spring-native.version>
2222
</properties>
2323

2424
<dependencyManagement>

server/src/main/java/org/springsource/restbucks/NativeConfiguration.java

-21
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,8 @@
1616
package org.springsource.restbucks;
1717

1818
import org.springframework.context.annotation.Configuration;
19-
import org.springframework.context.event.EventListener;
20-
import org.springframework.core.annotation.SynthesizedAnnotation;
21-
import org.springframework.nativex.hint.AccessBits;
2219
import org.springframework.nativex.hint.AotProxyHint;
23-
import org.springframework.nativex.hint.JdkProxyHint;
24-
import org.springframework.nativex.hint.NativeHint;
2520
import org.springframework.nativex.hint.ProxyBits;
26-
import org.springframework.nativex.hint.TypeHint;
27-
import org.springframework.transaction.event.TransactionalEventListener;
2821
import org.springsource.restbucks.drinks.Drink;
2922

3023
/**
@@ -33,21 +26,7 @@
3326
* @author Oliver Drotbohm
3427
*/
3528
@Configuration
36-
// Standard user component requiring proxying due to @Async
37-
@AotProxyHint(targetClassName = "org.springsource.restbucks.engine.Engine", proxyFeatures = ProxyBits.IS_STATIC)
3829

3930
// Due to DrinksOptions.BY_NAME (i.e. the usage of a domain type with Spring Data's TypedSort)
4031
@AotProxyHint(targetClass = Drink.class, proxyFeatures = ProxyBits.IS_STATIC)
41-
42-
// Referred to by a custom AttributeConverter
43-
// https://github.com/spring-projects-experimental/spring-native/issues/829
44-
@TypeHint(types = { org.javamoney.moneta.Money.class }, access = AccessBits.LOAD_AND_CONSTRUCT)
45-
46-
// Needed to get @TransactionalEventListener on Engine.process(…) working
47-
// https://github.com/spring-projects-experimental/spring-native/issues/828
48-
@TypeHint(types = { EventListener.class, TransactionalEventListener.class }, access = AccessBits.ANNOTATION)
49-
// Additional wrapping needed due to https://github.com/spring-projects-experimental/spring-native/issues/830
50-
@NativeHint( //
51-
jdkProxies = @JdkProxyHint(types = { TransactionalEventListener.class, SynthesizedAnnotation.class }) //
52-
)
5332
class NativeConfiguration {}

server/src/main/java/org/springsource/restbucks/core/MonetaryAmountAttributeConverter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public String convertToDatabaseColumn(MonetaryAmount amount) {
4545
}
4646

4747
@Override
48-
public MonetaryAmount convertToEntityAttribute(String source) {
48+
public Money convertToEntityAttribute(String source) {
4949

5050
if (source == null) {
5151
return null;

0 commit comments

Comments
 (0)