[JIRA] (HSEARCH-3275) Search 6 groundwork - Move to a stable implementation of Lucene spatial support
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HSEARCH-3275 ( https://hibernate.atlassian.net/browse/HSEARCH-3275?atlOrigin=eyJpIjoiMjN... )
Re: Search 6 groundwork - Move to a stable implementation of Lucene spatial support ( https://hibernate.atlassian.net/browse/HSEARCH-3275?atlOrigin=eyJpIjoiMjN... )
The context has changed and made most of this ticket obsolete.
First, LatLonPoint and related classes in Lucene are now in the core, not in the sandbox ( https://issues.apache.org/jira/browse/LUCENE-7314 ). They are thus supported to the same extent as other core features.
Second, the precision of LatLonPoint seems largely sufficient for most use cases. From the javadoc of org.apache.lucene.document.LatLonPoint :
>
>
>
> Values are indexed with some loss of precision from the
>
>
>
>
>
> original double values (4.190951585769653E-8 for the latitude component
>
>
>
>
>
> and 8.381903171539307E-8 for longitude).
>
>
In the worst case, for latitude, this gives a precision near the equator of 40,075.017/360*8.381903171539307*10^-8 = 9.33 cm, or around 3.7 inches. I'd say this is enough to find the location of a pizza joint or a rental bike, or for most use cases we're likely to encounter.
So, let's just add some documentation about the precision, that should be enough.
( https://hibernate.atlassian.net/browse/HSEARCH-3275#add-comment?atlOrigin... ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3275#add-comment?atlOrigin... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:dd08494 )
5 years, 11 months
[JIRA] (HHH-14017) Adding PK proxy using field access to non-pk mapped collection results in NULL constraint violation
by Christian Beikov (JIRA)
Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMzI0NTFjYjg4... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiMzI0NT... ) HHH-14017 ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiMzI0NT... ) Adding PK proxy using field access to non-pk mapped collection results in NULL constraint violation ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiMzI0NT... )
Change By: Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
A simple model that maps a collection through a unique column
{code:java}
@Entity
@Table(name = "base_object")
public class BaseObject implements Serializable {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(name = "name", nullable = false, unique = true)
private String name;
@ManyToMany
@JoinTable(
name = "related_objects",
joinColumns = @JoinColumn(name = "base_name", referencedColumnName = "name"),
inverseJoinColumns = @JoinColumn(name = "related_name", referencedColumnName = "name")
)
private Set<RelatedObject> related = new HashSet<>();
}
@Entity
@Table(name = "related_object")
public class RelatedObject {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(name = "name", nullable = false, unique = true)
private String name;
}
{code}
When trying to add a {{RelatedObject}} reference to the collection, the flushing fails with a NULL constraint violation, although the proxy is lazily initialized.
{code:java}
BaseObject b = entityManager.find(BaseObject.class, bId);
RelatedObject r = entityManager.getReference(RelatedObject.class, rId);
b.getRelated().add(r);
entityManager.flush();
{code}
Note that it works when using property mapping instead, so this seems to be related to the proxy not being narrowed before being accessed.
( https://hibernate.atlassian.net/browse/HHH-14017#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14017#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:dd08494 )
5 years, 11 months
[JIRA] (HHH-14017) Adding PK proxy using field access to non-pk mapped collection results in NULL constraint violation
by Christian Beikov (JIRA)
Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiN2ZjY2MxOTY5... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiN2ZjY2... ) HHH-14017 ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiN2ZjY2... ) Adding PK proxy using field access to non-pk mapped collection results in NULL constraint violation ( https://hibernate.atlassian.net/browse/HHH-14017?atlOrigin=eyJpIjoiN2ZjY2... )
Issue Type: Bug Affects Versions: 5.4.14 Assignee: Unassigned Components: hibernate-core Created: 12/May/2020 13:00 PM Priority: Major Reporter: Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
A simple model that maps a collection through a unique column
@Entity
@Table(name = "base_object" )
public class BaseObject implements Serializable {
@Id
@Column(name = "id" )
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(name = "name" , nullable = false , unique = true )
private String name;
@ManyToMany
@JoinTable(
name = "related_objects" ,
joinColumns = @JoinColumn(name = "base_name" , referencedColumnName = "name" ),
inverseJoinColumns = @JoinColumn(name = "related_name" , referencedColumnName = "name" )
)
private Set<RelatedObject> related = new HashSet<>();
}
@Entity
@Table(name = "related_object" )
public class RelatedObject {
@Id
@Column(name = "id" )
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(name = "name" , nullable = false , unique = true )
private String name;
}
When trying to add a RelatedObject reference to the collection, the flushing fails with a NULL constraint violation, although the proxy is lazily initialized.
BaseObject b = entityManager.find(BaseObject.class, bId);
RelatedObject r = entityManager.getReference(RelatedObject.class, rId);
b.getRelated().add(r);
entityManager.flush();
( https://hibernate.atlassian.net/browse/HHH-14017#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14017#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:dd08494 )
5 years, 11 months