Skip to content

Conversation

@gliljas
Copy link
Member

@gliljas gliljas commented Oct 28, 2025

Supporting DateOnly and TimeOnly. #2912

I have have working implementations of types that can store the values as int (20251028, 163215), but that may be something that should reside elsewhere.

I would very much like to support projecting properties like "Hour" and "Minute", even though a "ticks" based type is used. I had an implementation where the type itself could implement IHqlGeneratorForProperty, and the DateTimePropertiesHqlGenerator checked for this before going the default route. It worked well, but...

  1. Extracting the mapped type from the member expression is cumbersome.
  2. It would be nice to be able to support this in plain HQL as well. Not just LINQ.

Comment on lines +19 to +21
{

protected override string MappingsAssembly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: undue blank line.

Suggested change
{
protected override string MappingsAssembly
{
protected override string MappingsAssembly

Comment on lines +266 to +267
}
public class TestEntity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing blank line.

Suggested change
}
public class TestEntity
}
public class TestEntity

Comment on lines +44 to +48
///// <inheritdoc />
//public override object Get(DbDataReader rs, string name, ISessionImplementor session)
//{
// return Get(rs, rs.GetOrdinal(name), session);
//}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this dead code?

// object needs to have both class and serializable setup before it can
// be created.
RegisterType(typeof (Object), NHibernateUtil.Object, new[] {"object"});
RegisterType(typeof (Object), NHibernateUtil.Object, new[] {"object"});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probable trouble in previous suggestion, missing indent.

Suggested change
RegisterType(typeof (Object), NHibernateUtil.Object, new[] {"object"});
RegisterType(typeof (Object), NHibernateUtil.Object, new[] {"object"});

@fredericDelaporte fredericDelaporte added this to the next minor milestone Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants