Duality for rank one modules over a number ring Let $K$ be a number field, and $R$ an order of $K$. Consider the category $\mathcal{M}$ of all finitely generated $R$-submodules of $K$. If $X$ is an object of $\mathcal{M}$ such that $R=\textrm{End}_R(X)$, consider the contravariant functor $h_X:\mathcal{M}\to\mathcal{M}$ given by $T\to\textrm{Hom}_R(T,X)$, where the structure of $R$-module on $h_X(T)$ is induced from that on $X$.
I am interested in having conditions on the ring $R$ ensuring the existence of an $X$ as above for which $h_X$ is an anti-equivalence of categories.
So far I only know that in the following two cases such an $X$ exists:


*

*if $R$ is the maximal order of $K$, then $X=R$ works;

*if $K$ has a subfield $K_0$ with $[K:K_0]=2$ and such that $R\cap K_0$ is the maximal order of $K_0$ then $X=R$ works.


(The question is closely related to (and inspired by) the following: let $k$ be a finite field and $\mathcal{C}$ a $k$-isogeny class of $k$-simple ordinary abelian varieties over $k$. Does there exist an object $A$ of $\mathcal{C}$ such that any finite $k$-subgroup $H\subset A$ is equal to the intersection of the kernels of a suitable (finite) collection of isogenies $\varphi_i:A\to A$?)
 A: It seems more natural to define the category to consist of those finitely generated $R$-modules whose generic fiber is 1-dimensional (without choosing a preferred basis).  I use this viewpoint below.
If $R$ is Gorenstein then you can take $X=R$ since the dualizing complex for a Gorenstein local ring is concentrated in a single degree and as such as an invertible module (so the Hom above is the same as an RHom). This conceptually explains your second case with $R \cap K_0 = O_{K_0}$ for a subfield $K_0$ over which $K$ is quadratic since in such cases $R$ is Gorenstein (as after completion over $O_{K_0}$ we are confronted with a "quadratic order" over a discrete valuation ring, which is always monogenic and hence easily checked to be Gorenstein). 
In general $R$ is Cohen-Macaulay, so it is tempting to try to take $X$ to be its dualizing module (as the dualizing complex for a CM local ring is supported in a single degree), but if not projective (equivalently, $R$ not Gorenstein) then presumably the discrepancy between Hom and RHom may create some problems.  No doubt the experts in commutative algebra can supply a counterexample or explain why it is a non-issue in these circumstances. 
In fact, one is led to wonder (in the absence of any motivation being given for the question) whether the setup is simply "wrong": it is always true by taking $X$ to be the dualizing module (put in degree 0) that on the derived category $D^b_c(R)$ of "bounded complexes of $R$-modules with finitely generated homologies" that $T \mapsto {\rm{RHom}}(T,X)$ is an involutory auto-equivalence and ${\rm{RHom}}(X,X) = R$. That is, the dualizing module always works if you work in the appropriate derived category setting (which eliminates the 1-dimensionality restriction on the generic fiber, etc.). In the Gorenstein case we can apply ${\rm{H}}^0$'s throughout to recover the more concrete assertion with ordinary Hom's in that case. Is that not adequate for whatever motivated the question?
