Browse Source
This commit updates PersistenceManagedTypesBeanRegistrationAotProcessor in order to infer hints for Hibernate annotations meta annotated with `@ValueGenerationType` (like `@CreationTimestamp`) and `@IdGeneratorType`. `@GenericGenerator` is not supported as it is deprecated as of Hibernate 6.5. Closes gh-32842pull/33047/head
3 changed files with 134 additions and 31 deletions
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
/* |
||||
* Copyright 2002-2024 the original author or authors. |
||||
* |
||||
* 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 |
||||
* |
||||
* https://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. |
||||
*/ |
||||
|
||||
package org.springframework.orm.jpa.hibernate.domain; |
||||
|
||||
import java.time.Instant; |
||||
|
||||
import jakarta.persistence.Entity; |
||||
import jakarta.persistence.Id; |
||||
import org.hibernate.annotations.CreationTimestamp; |
||||
|
||||
@Entity |
||||
public class Book { |
||||
|
||||
@Id |
||||
private Long id; |
||||
|
||||
private String title; |
||||
|
||||
@CreationTimestamp |
||||
private Instant createdOn; |
||||
|
||||
public Book() { |
||||
} |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getTitle() { |
||||
return title; |
||||
} |
||||
|
||||
public void setTitle(String title) { |
||||
this.title = title; |
||||
} |
||||
|
||||
public Instant getCreatedOn() { |
||||
return createdOn; |
||||
} |
||||
|
||||
public void setCreatedOn(Instant createdOn) { |
||||
this.createdOn = createdOn; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue